how to get mailbox permissions on all users using powershell in an OU?

Rabbani Syed 41 Reputation points
2021-04-15T16:22:30.443+00:00

i wanted to extract the user mailbox having delegate permissions using powershell online exchange,
i try the following command to get the results

get-mailbox | get-mailbox permissions it get all the users but in my case i have an OU i wanted to search in my ou only

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.
2,896 questions
No comments
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,331 Reputation points Microsoft Employee
    2021-04-16T06:19:20.537+00:00

    Hi @Rabbani Syed

    Yes, agree with michev's suggestion, the OrganizationalUnit parameter in get-mailbox command filters the results based on the object's location in Active Directory.

    Are you having a hybrid environment or you just sync the users from on-premise AD to AAD?

    For the permission in Exchange online: Manage permissions for recipients in Exchange Online


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
     

    No comments

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 61,911 Reputation points Microsoft MVP
    2021-04-15T18:04:45.637+00:00

    There are no OU's in Exchange Online. You can still use the -Filter parameter to get only a subset of the mailboxes, or you can export the information to CSV from your on-premises AD and use the CSV as input for the Get-MailboxPermission cmdlet.