19

We have an issue with User Profile Sync in SharePoint 2010 when the following happens:

  • A new user is added to AD (i.e. DOMAIN\jdoh)
  • The user is synched successfully to SharePoint
  • Time passes
  • The user's account name is changed in AD (i.e. because it was originally misspelled: DOMAIN\jdoe)
  • The user is re-synced to SharePoint

The behavior appears to be that the account name is not changed. In the above example, accountname will continue to be DOMAIN\jdoh in SharePoint, though other properties are synced correctly- I would assume by SID. This means that the users' my profile and mysite links still refer to the 'old' name (ie Person.aspx?accountname=Domain\jdoh). What steps should be taken to fix this in SharePoint when an account name is changed in AD?

2

12 Answers 12

7

You need to execute the following Move-SPUser command (an equivalent of the STSADM MigrateUser command) for the user account in order to update the account name in SharePoint:

Move-SPUser -Identity "DOMAIN\jdoh" -NewAlias "DOMAIN\jdoe"
5

Have you tried forcing a sync with the following command?

Get-SPUser –Web http://SHAREPOINT-SERVER-NAME | Set-SPUser –SyncFromAD

3

The only solution we have found (that doesn't require writing code) is to delete the user from SharePoint and re-add them again.

Just make sure you know which groups their user resided.

2
  • Can user with new accountname access his previous data on the site. Will the new Accoutname points to the old data with old accountname??
    – Yayati
    Apr 20, 2017 at 7:09
  • 1
    I don't believe so because the new account will be created with a new account GUID. So existing account associations will be lost. However, if they have access to the same items based on their Groups, then it should not be an issue. Apr 24, 2017 at 19:59
3

http://sharepoint-sandbox.com/index.php?/SharePoint-2010/Sites/tip-104-updating-sharepoint-2010-user-information.html?directory=14 Actually I navigated to http:///_catalogs/users/detail.aspx and deleted user account. Then run "User Profile Service Application - User Profile to SharePoint Full Synchronization" job

2

What I did to force SharePoint to use the changed Account Name:

  1. In Central Administration go to the User Profile Service
  2. Go to Manage User Profiles and search for the useraccount.
  3. Delete the useraccount
  4. Start Profile Synchronization > Incremental Synchronization
  5. Ask the user to login (to re-create his profile).

Deleting the User Profile also deletes information like his account picture, ..., etc. So it might not be the solution you like.

1

set-spuser will not work if the account name in SharePoint does not match in AD.

If the account name does match but information such as email in incorrect, you can run the command.

0

you can delete the user from the site collection. If your isn't spelled correctly you will need to contact security to correct the spelling in Active Directory. Contact Exchange or other email administrator. You can then delete the user account and add the user. You would need to also add the user to the correct groups. After completing those steps, the user should receive an welcome email for the Groups they've been added to. I hope his helps.

0

Deleting the user from the site collection and adding them worked for me. For some reason trying to update via PowerShell kept throwing an invalid user identity error or Access Denied, depending on which site collection the user was in.

0

From the SharePoint Management Shell as Admin, verify your syntax and user info. The user should come up, but the DisplayName will still show their old name. This is good. I had to remove the "" marks around the user and the -Identity part.

Get-SPUser domain\usernamenew -web http://NLBClusterName

Okay, got the user. good. Now kick off the sync using Set.

Set-SPUser domain\usernamenew -SyncFromAD -web http://NLBClusterName

Worked great for me. SharePoint Foundations 2010, AD, and sharepoint clustered.

I needed to ensure the GUID remained for the user as there are many task records with the user on them. If the site was simpler, the deletion and resync option could have been okay, but in my situation it was not an option.

0
0

This is an old post, but I was looking for this and about to loose hope (and delete/recreate the user entry in the User Information List), but this finally worked for me after a user's login name was changed (to remove a diacritic, which should never have been there in the 1st place).

Situation:

  • SP2013
  • User was originally created with a diacritic in the login name (e.g. domain\josé)
  • AD and SP Profile successfully update to NOT contain diacritic (domain\jose)
  • User entry in the site collection (_catalogs\users) still contained diacritic

Solution:

  • $w = Get-SPWeb ...
  • $w.EnsureUser(<user's email>)

Result:

  • User entry NO longer contains diacritic, userID was preserved, all references to user in the site collection seem ok (Assigned To, Created By, etc.)
-1
Set-SPUser –Identity "domain\username" –SyncFromAD –Web https://xyz.com

It worked for me and it will update user information from AD to sharepoint site. some of time if user has given through NT AUTHORITY\Authenticated Users . then how you will remove EU inside NT AUTHORITY\Authenticated Users . so the best solution is, run the above command and fix your issue.

-1

Command:

Set-SPUser –Identity "domain\username" –SyncFromAD –Web https://mysitecollection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.