Office 365- Change UPN in 365 from PS

Last updated on March 26th, 2018 at 09:35 am

If DirSync can`t sync changes of username in 365 after changes in premised AD with 365 few steps to solve problem.
Example:
AD user is [email protected]
365 user is [email protected]
DirSync can sync smtp address but not the User and nothing happening after 48 hours
Step 1 – Connect to 365 Power Shell

Connect-MsolService

or

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection
Import-PSSession $Session

Step 2 – Run Command
Set-MsolUserPrincipalName -UserPrincipalName [email protected] -NewUserPrincipalName [email protected]
OR
Get-MsolUser -UserPrincipalName [email protected] | Set-MsolUserPrincipalName -NewUserPrincipalName [email protected]

Leave a comment

Your email address will not be published. Required fields are marked *