Sharepoint 2007 Sharepoint Active Directory配置文件-首选名称未得到更新

Sharepoint 2007 Sharepoint Active Directory配置文件-首选名称未得到更新,sharepoint-2007,Sharepoint 2007,我正在尝试更新SSP应用程序中的用户配置文件,我有10000条记录。其中大多数都是第一次更新,有21条记录在我每次运行代码时都会更新 我不知道为什么会这样 有人能帮我看看我的代码发生了什么吗 SPSecurity.RunWithElevatedPrivileges(delegate() { SPSite sc = new SPSite("http://xxxxx:81"); ServerContext context = Serve

我正在尝试更新SSP应用程序中的用户配置文件,我有10000条记录。其中大多数都是第一次更新,有21条记录在我每次运行代码时都会更新

我不知道为什么会这样

有人能帮我看看我的代码发生了什么吗

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++;
                }
}

多谢各位

哈里吉拉拉


NHS Direct

您知道SSP中已经有一个用户配置文件导入选项了吗?如果只导入广告属性,请使用该属性。仅当配置文件数据来自其他源时,才创建timerjob。如果AD中存在任何非标准属性,您也可以通过创建新的配置文件属性并定义它们映射到的AD属性来映射这些属性