List shared mailbox with NO users assigned, NO delegates

Shanal S 1 Reputation point
2021-11-08T11:20:52.663+00:00

Looking for a powershell script to generate a list of shared mailboxes with no delegation.

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 124K Reputation points MVP Volunteer Moderator
    2021-11-08T14:40:54.73+00:00

    Define "delegates"? Do you mean people with Full mailbox permissions? Or folder-level?

    Here's an easy to use cmdlet to cover any shared mailboxes without Full Access permissions:

    Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | ? { (Get-MailboxPermission $_.UserPrincipalName | ? {$_.User -ne "NT AUTHORITY\SELF"}).Count -eq 0 }
    

    If you want to cover folder-level permissions as well, best use a proper full-blown script, here's a sample one: https://www.michev.info/Blog/Post/3519/office-365-permission-inventory-calendar-permissions

    3 people found this answer helpful.

  2. KyleXu-MSFT 26,396 Reputation points
    2021-11-09T08:00:34.713+00:00

    @Shanal S

    I guess you are using Exchange online shared mailbox. You could use script below to check those shared mailbox(Save this script into a .ps1 file, then run this script in PowerShell after connecting to Exchange online):

    $mailboxes = Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails SharedMailbox  
      
    foreach($mailbox in $mailboxes){  
        If ((Get-MailboxPermission $mailbox.Name | where {$_.IsInherited -eq $false -and $_.Deny -eq $false -and $_.AccessRights -eq "FullAccess"}) -eq $null){  
            if((Get-RecipientPermission $mailbox.Name -Trustee "NT AUTHORITY\SELF") -ne $null){  
                if((Get-RecipientPermission $mailbox.Name | where {$_.Trustee -ne "NT AUTHORITY\SELF"}) -eq $null){  
                    Write-Host($mailbox.Name)  
                }  
            }               
        }  
    }     
    

    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.


    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.