Change Search Base to distinguished name of designated OU
Change UPN's In Active Directory
Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase 'distinguished name' -Properties userPrincipalName | foreach { Set-ADUser $_ -UserPrincipalName "$($_.givenname + "." + $_.surname)@test.com"}
No comments:
Post a Comment