2

The Active Directory attribute userPrincipalName and related to this samAccountName have to be changed. As the users are active users in SharePoint the Move-SPUser command has to be used.

So the way to tell SharePoint about the new login is:

  1. user must log off
  2. UPN/SAN in Active Directory changed
  3. Move-SPUser command on APP Server Management Shell
  4. User Profile Sync - Full Sync in Central Administration
  5. Wait a long time (few hours)
  6. user logging in again

Code for step 3:

$web = Get-SPWeb "https://sharepoint.site.the.user.visited.before" 
$user = Get-SPUser "i:0#.w|DOMAIN\vn" –Web $web 
Move-SPUser –Identity $user –NewAlias "i:0#.w|DOMAIN\v.name" –IgnoreSID 

Summary: Everything works fine in SharePoint - but there is one major problem with this procedure: All Newsfeed posts of this user made in the past disappeared. They can still be found in Enterprise Search. If clicked there is an "something wrong" error. If visiting a site with Site Feed on it where the user answered in the past, the main post is still there as well as all other replies, but the replies of this user are not shown any more. His old posts seem to be lost!

2 Answers 2

1

Solution:

It turns out that the Move-SPUser command just goes trough all people columns and replaces the old username by the new one. Newsfeeds (MicroFeed list on team sites/project sites) store the information about persons who posted in a column PostAuthor which is (don't ask me why Microsoft did this!) not a people column but a single line of text column. So the Move-SPUser does not affect this column and it has to be changed manually in any way. I think a PowerShell script would be the tool of choice to do this.

Edit: Have had contact to Microsoft SA Support regarding this case. They do not recommend changing user names. They say it would be better creating new users instead of changing user name. This means lots of work (NTFS permissions, distribution groups, sharepoint permissions, user profiles on end devices...).

0

I would try repopulating the Feed Cache for the user in question. Update-SPRepopulateMicroblogLMTCache (This cmdlet must be run first.) Update-SPRepopulateMicroblogFeedCache -AccountName (Using the new alias)

1
  • Thank you for your suggestion. This is what I tried now: '$upp = Get-SPServiceApplicationProxy | where {$_.TypeName -like "User Profile Service Application Proxy"} $uppID = $upp.Id Update-SPRepopulateMicroblogLMTCache - ProfileServiceApplicationProxy $uppID Repopulation successfully started. Update-SPRepopulateMicroblogFeedCache - ProfileServiceApplicationProxy $uppID -AccountName "i:0#.w|DOMAIN\v.name" Repopulation successfully started.' But after waiting one hour, no change. Sorry.
    – PhilFancy
    Commented Dec 20, 2017 at 14:55

Your Answer

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

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