What RBAC role is required to run the cmdlet Get-EXOMailbox -IncludeInactiveMailbox please?

Dave 79571234 1 Reputation point
2020-08-04T15:08:47.227+00:00

What RBAC role is required to run the cmdlet Get-EXOMailbox -IncludeInactiveMailbox please?

I'm currently getting this error when I try to run it:
Get-EXOMailbox : Error while querying REST service. HttpStatusCode=500
ErrorMessage={"error":{"code":"InternalServerError","message":"Error executing request. The \"IncludeInactiveMailbox\"
parameter can't be used on the \"Get-Mailbox\" cmdlet because it isn't present in the role definition for the current
user. Check the management roles assigned to you, and try again."

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,233 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 96,516 Reputation points MVP
    2020-08-04T15:36:17.42+00:00

    Should be the same as Get-Mailbox requirements, so check via:

    Get-ManagementRole -CmdletParameters IncludeInactiveMailbox -Cmdlet Get-Mailbox
    
    0 comments No comments

  2. Joyce Shen - MSFT 16,646 Reputation points
    2020-08-05T02:47:37.15+00:00

    Agree with Michev, you could use the command above to get the roles needed to run the command.

    15598-snipaste-2020-08-05-10-47-22.png

    In addition, please also note that: This cmdlet Get-EXOMailbox is available only in the Exchange Online PowerShell V2 module.

    I tried in my environment and it can work properly

    15597-snipaste-2020-08-05-10-45-25.png

    0 comments No comments