SOLVED

Exchange online permission error

Brass 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 (Brass Contributor)
Solution
My problem was that I used domainname to connect, not domainname.onmicrosoft.com. There was a hint in some Microsoft documentation.
1 best response

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

View solution in original post