0
我正在嘗試更新我的SSP應用程序中的用戶配置文件,並且我有10000條記錄。其中大部分都是第一次更新,每次運行代碼時都會有21條記錄被更新。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++;
}
}
謝謝
哈日Gillala
NHS直接