Hi again,
The other day a colleague ask me a quick way to update the UPN of a bunch of users in order to be ready to access to O365.
Firstly, and before running the below PowerShell, add the UPN that you are going to use (your verified domain in Office 365) to Active Directory Domains and Trusts. Then in a PowerShell console as an administrator, execute the following command:
$users = Get-ADUser -filter * -Server domain1.com -resultsetsize $null foreach($user in $users) { $UPN = "$($user.sAMAccountName)@yourFederatedO365domain.com" # Write-Host "Setting " $UPN $user | Set-ADUser -UserPrincipalName $UPN }
That’s all