Programatically Create My Site in Sharepoint 2010
A short code snippet for Programatically creating My Sites in SharePoint 2010
public void CreateMYSite()
{
SPServiceContext serviceContext = SPServiceContext.Current;
UserProfileManager up = new UserProfileManager(serviceContext);
string sAccount = "domain\\user";
UserProfile uprof = up.GetUserProfile(sAccount);
uprof.CreatePersonalSite();
SPSite newmysite = uprof.PersonalSite;
}
public void CreateMYSite()
{
SPServiceContext serviceContext = SPServiceContext.Current;
UserProfileManager up = new UserProfileManager(serviceContext);
string sAccount = "domain\\user";
UserProfile uprof = up.GetUserProfile(sAccount);
uprof.CreatePersonalSite();
SPSite newmysite = uprof.PersonalSite;
}
0 comments:
Post a Comment