Tag Archives: Access Denied

Set-MsolUserPrincipalName : Access Denied.

5 Dec

Most of the time, you see the “Access Denied. You do not have permissions to call this cmdlet” error message because of a non-existent UPN name in the “-UserPrincipalName” parameter.

To verify this, you can combine Get-MsolUser and Set-MsolUserPrincipalName cmdlets to include this validation check to get some more meaningful error message.

I suggest you replace “Set-MsolUserPrincipalName -UserPrincipalName $365 -NewUserPrincipalName $email

with “Get-MsolUser -UserPrincipalName $365 | Set-MsolUserPrincipalName -NewUserPrincipalName $email” and let us know the outcome.

Advertisements