MOSS 2007 : how to update document uploader username ?
Hi everyone, I have a MOSS 2007 farm (1 single server including all MOSS roles and SQL) into Active Directory. I've be recently asked to update (synchronize) all MOSS usernames with AD after changing names of user into AD. It worked (central admin -> Shared services -> user profiles) The problem is that some old documents were uploaded to MOSS doc librairies and the username of the uploader did not sync. Is anyone know that problem and the solution ? Thank you for helping.
October 29th, 2010 4:24am

You are correct, Sometimes the user/group name won't be synchronzed if there is any change in the AD user profile properties. Normally SharePoint will create a new entry in the userinfo table if new user added to a web. This userinfo entry is for each site collection. To get the correct name on the web you need to force details using Object mode. Below code will be more useful to you. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; namespace UseraccountUpdate { class Program { static void Main(string[] args) { string loginName = string.Empty; string userName = string.Empty; string siteColl = string.Empty; Console.Write("Enter the Site Collection URL : "); siteColl = Convert.ToString(Console.ReadLine().Trim()); Console.Write(@"Enter the Login name (e.g. Domain\UserName) : "); loginName = Convert.ToString(Console.ReadLine().Trim()); Console.Write("Enter the corrct user name : "); userName = Convert.ToString(Console.ReadLine().Trim()); if (siteColl.Length > 0 && loginName.Length > 0 && userName.Length > 0) { try { using (SPSite fastTRackSite = new SPSite(siteColl)) { fastTRackSite.AllowUnsafeUpdates = true; using (SPWeb web = fastTRackSite.OpenWeb()) { web.AllowUnsafeUpdates = true; SPUser user = web.AllUsers[loginName]; user.Name = userName; user.Update(); } } Console.Write("Done"); } catch (Exception ex) { Console.Write("Error: " + ex.Message); } } else { Console.WriteLine("Please enter valid input values"); } Console.ReadLine(); } } } Senthilrajan Kaliyaperumal
Free Windows Admin Tool Kit Click here and download it now
October 29th, 2010 5:38am

Thanks Senthil for post I am newbie to Sharepoint. i had a problem my Userinfo table is not sync with the SSP. First there are multiple records in Userinfo for a single user. The active user details is not in sync with SSP information, while the inactive user are in sync. There are bunch of user with similar issue Please suggest
June 15th, 2011 6:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics