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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: