Link to home
Start Free TrialLog in
Avatar of Dan
DanFlag for United States of America

asked on

Sharepoint question

I am using the built in sharepoint that comes free with Windows server 2008 R2.
I had a user change your name because she got married.  I've made the changes in AD last year, and everything was fine, but the user just asked me why when she logs into sharepoint, it uses her old name.

I tried deleting the user and every time I add the user, even though I use the new format:  domain\username
it still reverts back to the old last name.

I searched through AD, and the old name doesn't exist anywhere.  How do I resolve this issue?  

I'm puzzled.
Avatar of Walter Curtis
Walter Curtis
Flag of United States of America image

Try this, line by line
Add-PSSnapin Microsoft.SharePoint.Powershell
$web = Get-SPWeb http://webapp
$user = get-spuser -web $web -identity "Incorrect display name exactly as it is shown in SharePoint"
Set-SPuser -identity $user -web $web -DisplayName "New display name to be set by PowerShell"

User names should be in the format Domain\UserName

This is just a band aid for what might be a larger problem, such as UPS not syncing or running.

Hope that helps
Avatar of Dan

ASKER

are you saying to run that code on my sharepoint server, right?

I've never worked with powershell, so hopefully that won't brake anything
Just to confirm the format, let me know if this is what I should be entering:

Add-PSSnapin Microsoft.SharePoint.Powershell
$web = Get-SPWeb http://webapp
domain\username = get-spuser -web $web -identity "First name & last name spelled incorrectly"
Set-SPuser -identity domain\user -web $web -DisplayName "First name & last name spelled incorrectly"

where it says http://webapp   do I change this to my own http address of my sharepoint?

also, can this break anything?  I'll do a backup, but I have no idea how to restore it if it breaks sharepoint
Yes, your address of you SharePoint goes where is says http://webapp
If you have never worked with PowerShell, you might want to read up on it some however before you start.
Avatar of Dan

ASKER

what is UPS not syncing, so how would I know what the exact problem is, just curious?
Avatar of Dan

ASKER

since the snapin was already installed, it didn't install it.

Then it the 2nd line fine with no errors

The third line though came back with an error.  The picture is attached.User generated image
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 Dan

ASKER

What's really strange is that when I deleted and added the user again,
the name displayed is wrong, but the account is correct.

For example: Let's say:
the user's old name was:  Ana Doe
the user's new name is: Ana Smith

In sharepoint, it shows the name as  Ana Doe\asmith

So the user account is correct, but the name displayed is wrong.  

I checked everywhere in AD and I have no idea where it's getting that information because AD is correct.

Should I still process the commands you suggested as the user account is correct, it's just that the name displayed is wrong.
Yes, you are seeing the display name from the user table in the content database. Run the commands.
Avatar of Dan

ASKER

THANK YOU SO MUCH!!!!!!!!!!!

it worked!!!!!!!!!!!!!!!!!!!!!
You're welcome. Glad I could help you.