SharePoint Experts, Information Architects, Expert Witness

SICG provides a broad array of business and technology consulting from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. We focus on the "How", not just the possible. Contact me direct: or call 704-873-8846 x704.

Search This Blog

Thursday, June 2, 2011

SharePoint displays users as Domain\Username instead of Display Name

Recently had a client discover that SharePoint 2010 was displaying users as domain\username instead of the Display Name as it is in Active Directory; oddly it wasn't all accounts either. After some deep searching, I found the following fix. Using the SharePoint Command Shell do the following:

1) If the problem only appears with a single user, you can update a single account like so:

Set-SPUser -Identity ‘domain\Username’ –Web http://<URL To Site> –SyncFromAD

2) If all (or a lot) of the uesrs you can do it by the following:

Get-SPUser –Web http://<URL to Site> | Set-SPUser –SyncFromAD

The above will reset all users FOR THAT SPECIFIC URL; if you have additional site collections (i.e. Managed Paths), you have to run it on those URL's as well.

NOTE: You will often get an error for 'invalid' accounts such as Local Service - you can generally ignore the message as long as users show up correctly.


Anonymous said...

This worked Great! Thanks for sharing... it was killing my OCD having some users with the domain and some without!

mommy of 3 said...

i was trying to "Add New Link" on the sharepoint page which should look like this:[username]&email=[emailaddress]

where the [username] should replace with current login network username.
can i also get the emailaddress as well?

David M. Sterling said...

Not sure I follow you exactly, but yes the email address should work as well. In general, SharePoint will validate with domain\name, name and email address.

Bruno Ravizzini said...

Hi, I alos have to do this:[username]

Send by GET the username (current login suername of sharepoint) whith a link.

Please help to solve it, how to do it and where to insert it in sharepoint page.

thanks a lot.

David M. Sterling said...

If you are trying to capture the User, the personalization web part will do that for you. If you are trying to embed it in a link (that is what it looks like), you can do this using the Client Side object model and JavaScript - see here:

Bruno Ravizzini said...

Thanks, that's what I need, capture the username, and embed it in a link, so to receibed it in a php module by GET.

Thanks for your answer.

Bruno Ravizzini said...

Dear David, I ask you to explain to me how to do it in detail, would be great if you can show me an example, please, I have to solve this problem at my work... How do I have to insert the personalized webpart? so to show me the current username.
I guess I have to do it with the Designer, I am working with Sharepoint 2007. I have a page of my Sharepoint intranet where I want to capture the username, display it and also send it as a variable in a to another external site.
Please if you could help me, I will be grateful.

David M. Sterling said...

There are multiple ways to get the user name from .NET, the API and from JavaScript. I sent you the one on the API.