Active Directory Profiles Active Directory

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.

+4
source share
1 answer

In sharepoint 2007, SPSite is owned by SPWebApplications, which are associated with SSPs that retain user profile properties.

 SPSite sc = new SPSite("http://xxxxx:81"); ServerContext context = ServerContext.GetContext(sc); 

The effectiveness of these lines is looking for the SSP associated with the SPSite URL that you are submitting.

It looks like you have only one SSP, so any SPSite-url that you use in the constructor will give you a link to the correct SSP.

As soon as the information is stored in the SSP database, the timer job copies the information from the SSP repository to separate SPSite databases in the hidden list "User data list".

This link explains this in 2010, let me see if I can find it for 2007:

http://www.harbar.net/articles/sp2010ups.aspx

EDIT

I found a link to explain 2007 for you:

http://blah.winsmarts.com/2007-7-MOSS_User_Profile_Info_-_How_the_information_flows.aspx

+3
source

Source: https://habr.com/ru/post/1335529/


All Articles