Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Change UPN to SamAccountName@specifieddomain
- # useful if needing to switch UPNs or to set UPNs before using DirSync for OnPrem to O365 Directory Synchronization
- # Should add domain, i.e. contoso.com to UPN Suffixes in properties in Active Directory Domains and Trusts first
- Import-Module ActiveDirectory;get-aduser -filter {Name -like "*"}|foreach{Set-ADUser $_ -UserPrincipalName ("{0}@{1}" -f $_.SamAccountName,"contoso.com")}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement