I have written the following code to edit the User Profiles for MOSS 2007. User Profiles are being populated through the 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++;
}
}
The Details are being updated properly.
My question is Which site do I need to use, to update the details.
For Example I have SSP service WebApplication, Central Administration Web Application and Other Web Applications.
Which Site I need to use to update the profiles, So that the profile name gets updated in all the Sites.
Could Anybody point me in the right direction.
Thank You. Hari Gillala NHS Direct.