SOLVED

Exchange online permission error

Occasional Contributor

Hello!

I am using a PowerShell script or least trying...  to connect Exchange online. The script connect in non-interactive mode, I am using an Azure application to log in, which I uploaded a certificate, followed from this post: https://adamtheautomator.com/exchange-online-v2/#Setting_Up_App-Only_Authentication_using_PowerShell . I can log in, I can use the Get-mailbox command, but, when I am try to use the set-mailbox I am getting an error:

brogyi_0-1661435223806.png

The application had the Exchange Administrator directory role, but later I upgraded to Global Admin, still I am getting the same error. The only thing I am understanding that there is a permission issue. 

Any help would be appreciated.

1 Reply
best response confirmed by brogyi (Occasional Contributor)
Solution
My problem was that I used domainname to connect, not domainname.onmicrosoft.com. There was a hint in some Microsoft documentation.