using (SPSite site = new SPSite(siteUrl))
{
if (!site.RootWeb.Exists)
{
throw new FileNotFoundException();
}
SPServiceContext serviceContext = SPServiceContext.GetContext(site);
UserProfileManager profileManager = new UserProfileManager(serviceContext);
UserProfile profile = null;
if (profileManager.UserExists(MySiteOwner))
{
profile = profileManager.GetUserProfile(MySiteOwner);
}
else
{
profile = profileManager.CreateUserProfile(MySiteOwner);
}
profile.CreatePersonalSite();
}
SharePoint2010创建MySite
最新推荐文章于 2023-08-10 14:04:40 发布