The User Profile Database in SharePoint is a great centralized location for storing all the information about the users of your SharePoint Portal.
To import the AD profiles in SharePoint then we have use UserProfileConfigManager class.
Add following references in solution:
using Microsoft.SharePoint;
using Microsoft.Office.Server.UserProfiles;
using Microsoft.Office.Server;
using System.Web;
and the following code
SPSite HomeSite = new SPSite("http://mossvs2008");
UserProfileConfigManager SPUserProfileConfigManager = new UserProfileConfigManager(ServerContext.GetContext(HomeSite));
if (SPUserProfileConfigManager.IsImportInProgress() == false)
SPUserProfileConfigManager.StartImport(true);
No comments:
Post a Comment