I wrote the following code to edit user profiles for MOSS 2007. User profiles are populated through Active Directory.
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++; }
}
Details are updated accordingly.
My question is: which site do I need to use to update the details.
For example, I have the SSP WebApplication service, the Central Administration Web application, and other web applications.
Which site do I need to use to update profiles so that the profile name is updated in all Sites.
Can someone point me in the right direction.
Thanks. Hari Gillala NHS Direct.
source share