$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
↧