$ln = "AD\jdoe"
$nm = 'Doe, John'
foreach($s in (Get-SPSite -Limit ALL)){
foreach($w in $s.AllWebs){
$cu = $w.AllUsers[$ln]
if($cu -ne $null){
if($cu.name -ne $nm){
$w.Url
Write-Host "Replacing $($cu.name) with $($nm)"
$cu.DisplayName = $nm
$cu.Update()
}
}
}
}
Comments