Link to home
Start Free TrialLog in
Avatar of COCO3515
COCO3515

asked on

Sharepoint User Name Displaying incorrectly.

One of our users changed her last name after she married, so I updated her last name in Active Directory
but her last name is still show her old one, when she logs into her Sharepoint home page.
I'm not sure where else her last name could be stored, because we control our Sharepoint 2013
user permissions thru Active Directory.  Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Walter Curtis
Walter Curtis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of COCO3515
COCO3515

ASKER

Thanks!  I'm not familiar with Powershell.  When I typed in the 1st command,
it gave me the error message below:
"No snap-ins have been registered for Windows PowerShell version 2"
Can you please provide me a detailed step by step instruction?  
Thank you!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Make sure you are on the SharePoint server.
Start the SharePoint Management Shell as Eldrick mentioned.
Follow the steps line by line as my post above.

Note
You may get an error or message after the first line because the snapin will be added. Ignore the message
Use your SharePoint URL for line two
Line three and four are self explanatory

If  you want to test first, use  your user account maybe or a test account.

Hope that helps...
I'm able to use PowerShell on the server now. Thanks!
The first command below was accepted by the server with no errors
$web = Get-SPWeb http://mysharepointserver.

but when I typed in the second command,
$user = get-spuser -web $web -identity "jjohnson"
it gave the error below,

get-spuser : You must specify a valid user object or user identity.
At line:1 char:9
+ $user = get-spuser -web $web -identity "JJohnson"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Share....SPUserPipeB
   ind:SPUserPipeBind) [Get-SPUser], PSArgumentException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetUser
Use the domain name - domain\username
It still gave me the same error when I tried domain\username.
You will need to determine exactly what the user name is. If you run this line you will see the exact name:

$web.siteusers | ?{$_.userlogin -like "*J*"} | ft -a

Open in new window


You can refine the filter if you have too many results.
Once you have the exact name, use it in line 3 to get the user. Then go on to line 4
Thanks!  This command showed all usernames that start with "J" on our Domain
but I'm not sure why it's not showing the user we are working on.  I'm very sure that
this user is not having any issues connecting to other applications in our Domain.
Check for the maiden name. The command checks the name in SharePoint, not AD, even though they should be in sync, sometimes they aren't for various reasons we won't get in to here.
Also,  I was able to run the other command below using another user.
$user = get-spuser -web $web -identity "domain\jwilliams"
It's a mystery why user "domain\jjohnson" is not in the list.
She's also not having any issues using SharePoint. Just her name is incorrectly displayed.
What name is displayed when she logs in to SharePoint? That is the name you should look for and then change.
It's showing the old name "Joan Johnson" in SharePoint when she logs in using username "jjohnson".
It should be showing her new name when she logs in with the same username "jjohnson".
Exchange Server is showing her new name correctly so may be there is a place
in SharePoint where users are managed in addition to A.D. for this user?
Then you want to use the name "Joan Johnson". Yes, there is a place in SharePoint that controls the display name and that is what the powershell code manages. SharePoint does not really manage the user as AD does at all, it just manages the display name. You could change the name to anything you want.

Keep in mind, the initial question was how to change the display name, not a deep look in to how SharePoint works.
I've tried every possible search for this user using the command lines you've provided
but the system is saying that it doesn't have it and I know it has it.

I agree this is going beyond the scope of the original question because
the system is not behaving as it normally should have in this case.

I just wanted to try EE first because I didn't want to use up one of the four incident
based support call that comes with MSDN just for a display name problem
but looks like I would have to use it now.  Thanks for your help!
When the user logs in, what user name do they use? That is the user name you should update.

When the user logs in, they use the most current AD name. SharePoint authenticates with AD using the provided credentials. However, within each SharePoint content database there is a table that links AD names with Display Names. The reason for that is because it allow flexibility of what name is displayed on the screen when the user is working with SharePoint.
(Here is an example why: at one company I was at user names were a 6 digit number, which was used very discreetly. The users logged in using that number which was the user name. BUT, company dictated that the number should not be displayed anywhere or used any where that was visible. Using the display name functionality of SharePoint, the numeric name was mapped to a clear text display name which was first name and last name.)

The display name system in SharePoint is managed by powershell. In order to show a different display than what the actual user name is, the lines of code shown above are used. That means, you need to just know the user name and what display name you want.

Yes, this system should stay in sync with AD, but sometimes it does not. It depends upon a few other services that sometimes are out of sync. Actually, these problems usually clear up over the weekend when most full syncs are schedules at most companies.

Thanks for closing the question. Maybe this additional information will help you understand what is going on so you can make better sense out of it all. Keep me updated please.

Good luck...