我編寫了以下代碼來編輯MOSS 2007的用戶配置文件。用戶配置文件正在通過Active目錄進行填充。Sharepoint-活動目錄配置文件
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPSite sc = new SPSite("http://xxxxx:81");
ServerContext context = ServerContext.GetContext(sc);
HttpContext currentContext = HttpContext.Current;
HttpContext.Current = null;
UserProfileManager profileManager = new UserProfileManager(context);
foreach (UserProfile profile in profileManager)
{
if (profile[PropertyConstants.PreferredName].ToString().Contains("Domain\\"))
{
profile[PropertyConstants.PreferredName].ToString().Replace("Domain\\", "").ToString();
profile.Commit();
NoOfUser++;
}
}
細節都被正確地更新。
我的問題是我需要使用哪個站點來更新細節。
例如,我擁有SSP服務WebApplication,管理中心Web應用程序和其他Web應用程序。
我需要使用哪個站點來更新配置文件,以便在所有站點中更新配置文件名稱。
難道有人指出我在正確的方向。
謝謝。 Hari Gillala NHS Direct。
非常感謝回覆。這真的很有幫助。很好的解釋。謝謝 – 2011-01-14 11:49:23