Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $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()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement