permissions and mailboxes for shared mailboxes

Андрей Михалевский 2,846 Reputation points
2023-05-30T12:25:53.09+00:00

Hello.

I have a lot of shared mailboxes. I need to get all the shared mailboxes, find out the list of users and rights. I also need to get unique users that do not overlap in groups.

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,187 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,676 Reputation points Microsoft Vendor
    2023-05-31T02:36:20.25+00:00

    Hi @Андрей Михалевский

    Are you using Exchange on-premises or Exchange Online?

    If Exchange on-premises you can run scripts like below in Exchange Management Shell to export the results to a csv file:

    $Result = Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited |
    foreach{
    	$FullAccess = Get-MailboxPermission $_.Name | where-object {($_.User -notlike "NT AUTHORITY\SELF") -and ($_.IsInherited -eq $false)}
    	$SendAs = Get-Mailbox -Identity $_.Name | Get-ADPermission | where-object {($_.User -notlike "NT AUTHORITY\SELF") -and $_.ExtendedRights -like "*send*"}
    	New-Object psobject -Property $([ordered]@{
    	Shared_Mailbox = $fullaccess.identity
    	FullAccess_Users = $fullaccess.user
    	SendAs_Users = $SendAs.user
    	})
    }
    $Result | Export-Csv C:\temp\Shared_Mailbox_Delegates.csv
    
    
    
    

    I also need to get unique users that do not overlap in groups.

    Would you clarify more on the requirement?

    Do you mean getting users that only belong to a single distribution list? (To me which may be another question not related to the original question about getting shared mailbox permissions)

    If yes, kindly note that Microsoft Q&A forum recommends only asking one question per thread unless the questions are related.

    Please consider creating another thread for this question.

    It would also make it easier for community members to search questions and find answers.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    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.


0 additional answers

Sort by: Most helpful