开发者

Sharepoint-Active Directory Profiles

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 updat开发者_如何学JAVAe 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.


With sharepoint 2007, SPSite's belong to SPWebApplications, which are associated with an SSP, which store the user profile properties.

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

Those lines effectivity lookup the SSP associated with the SPSite url you pass in.

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

Once the information is stored in the SSP database, a timer job copies the info from the SSP store to the individual SPSite databases, into a hidden list "User Information List"s.

This link explains it for 2010, let me see if i can find it for 2007:

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

EDIT

I found the 2007 explanation link for you:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜