Wednesday 13 June 2018

Forcing Synchronization of Display Name and Email from Active Directory without User Profile Synchronization - PowerShell Script

Just made this script to Synchronize Display Name and Email for all users in a root web if they have been updated in AD and aren't flowing through to your display name in SharePoint. This may be required if the user profile service is not set up or is failing. This problem is discussed in more detail at https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#As discussed in https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c 

Write-Host  -ForegroundColor Yellow "-------------------Process Start---------------------------------------------------------------"
Write-Host  -ForegroundColor Yellow "This script will sync the AD display name and email from AD without running a user profile sync"
Write-Host  -ForegroundColor Yellow "As discussed in https://gallery.technet.microsoft.com/office/User-Information-List-in-8b420e8c" 
Write-Host  -ForegroundColor Yellow "-------------------Process Start---------------------------------------------------------------"

$stopWatch = [Diagnostics.Stopwatch]::StartNew()

$rootWeb = Get-SPWeb "https://demo01.berkeleyit.com/"
ForEach ($user in $rootWeb.AllUsers)
{
    Write-Host  -ForegroundColor Green "Syncing Email and DisplayName with Active Directory... for $user" 
    Set-SPUser -Web $rootWeb -identity $user.UserLogin -SyncFromAD
}

$stopWatch.Stop()

$timeTaken = $stopWatch.Elapsed

Write-Host  -ForegroundColor Yellow "-------------------Process Completed in $timeTaken second(s)------------------"

4 comments:

Anonymous said...


Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Website. Please feel free to visit our site. Thank you for sharing. iot course fees in chennai | iot certification courses in chennai | iot training in chennai | iot training in chennai quora

rose said...

Biology Assignment Help
chemistry Assignment Help
Physics Assignment Help
Assignment Help having an extraordinary notoriety among understudies, we convey learning with full data. Our specialists are mainstays of our administration. These journalists are completely fruitful in their training that they endeavor hard to give splendid work on task composing.

hrroman said...

If you are stuck with your Management assignment then in this case you can opt for our Management Assignment. we provide the bestMarketing assignment help.We also provideConsumer Behaviour Assignment Help for students across the globe. for more information contact us +16692714848.

Rebecca Virginia said...


We are the best Chemistry homework help services for college students in the UK.