Specific User out of sync with AD? update UserProfile via Powershell with Set-SPUser
Recently we had an issue where we had two web applications running on one farm , sharing the userprofile.
One username was changed in AD and User Profile successfully synced and updated this userprofile account.
When going to the one specific Web Application Site the user once logged in still had the old username as its welcome header.
After a couple of full and incremental syncs of the profile services it still did not update the users info for the specific site while the other site was perfect.
We then turned to powershell for its solution:
PS C:\Users\spsIntAdmin> Get-SPUser -Identity ourcompany32734 -Web http://storeportal | fl
Name : Isithame Usave 054423 ßOLD DATA OUT OF SYNC
Email : 054423
Notes :
LoginName : OURCOMPANY\032734
Groups : {}
OwnedGroups : {}
ID : 4879
Xml : <User ID="4879" Sid="S-1-5-21-343818398-1993962763-1644491937-50661" Name="Isithame Usave 054423" LoginName="OURCOMPANY32734" Email="054423" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" />
RawSid : {1, 5, 0, 0…}
Sid : S-1-5-21-343818398-1993962763-1644491937-50661
IsSiteAdmin : False
IsSiteAuditor : False
IsDomainGroup : False
IsApplicationPrincipal : False
RequireRequestToken : False
AllowBrowseUserInfo : True
Alerts : {}
UserToken : Microsoft.SharePoint.SPUserToken
RegionalSettings :
ParentWeb : Store & Regional Portal
Roles : {}
UserLogin : OURCOMPANY32734
DisplayName : Isithame Usave 054423
First we confirmed it was out of sync by Get-SPUser
PS C:\Users\spsIntAdmin> Set-SPUser -Identity ourcompany32734 -Web http://storeportal -SyncFromAD
We then ran a update of the specific user to sync with AD
PS C:\Users\spsIntAdmin> Get-SPUser -Identity ourcompany32734 -Web http://storeportal | fl
Name : Isithame Usave 032734
Email : 032734
Notes :
LoginName : OURCOMPANY\032734 ßBACK IN SYNC
Groups : {}
OwnedGroups : {}
ID : 4879
Xml : <User ID="4879" Sid="S-1-5-21-343818398-1993962763-1644491937-50661" Name="Isithame Usave 032734" LoginName="OURCOMPANY32734" Email="032734" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" />
RawSid : {1, 5, 0, 0…}
Sid : S-1-5-21-343818398-1993962763-1644491937-50661
IsSiteAdmin : False
IsSiteAuditor : False
IsDomainGroup : False
IsApplicationPrincipal : False
RequireRequestToken : False
AllowBrowseUserInfo : True
Alerts : {}
UserToken : Microsoft.SharePoint.SPUserToken
RegionalSettings :
ParentWeb : Store & Regional Portal
Roles : {}
UserLogin : OURCOMPANY32734
DisplayName : Isithame Usave 032734
We confirmed its, back in sync.
Thanks PowerShell!



