Quantcast
Viewing all articles
Browse latest Browse all 12198

Sample AD PowerShell command to update UPNs in bulk:

$0 $0 Get-ADUser-Filter * -properties homemdb | where {$_.homemdb -ne $null} | ForEach-Object ($_.SamAccountName) {$CompleteUPN = $_.SamAccountName + "@contoso.com"; Set-ADUser -Identity $_.DistinguishedName -UserPrincipalName $CompleteUPN}$0 $0 $0 $0 The above script:$0 $0 · Gets all users with something in their homemdb attribute (i.e. mailbox users)$0 $0 · Creates a temporary variable called $completeUPN which is a combination of every user’s samaccountname plus @conto

Viewing all articles
Browse latest Browse all 12198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>