How to extract List of all Users Who Have Full Access, Send As and Send on Behalf to Other Exchange Mailboxes.

Mohammad Ashraful Haque 1 Reputation point
2021-05-07T01:10:50.357+00:00

Hi Experts,

I need the script :

How to extract List of all Users Who Have Full Access, Send As and Send on Behalf to Other Exchange Mailboxes.

It is Okay, if there is separate command for these access.

Thank you.

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,357 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lucas Liu-MSFT 6,161 Reputation points
    2021-05-10T04:12:43.397+00:00

    Hi @Mohammad Ashraful Haque ,
    According to my research, we cannot directly obtain the permissions of the user's mailbox to other mailboxes.We can know whether each user mailbox contains the "Full Access", "Send As" and "Send on Behalf" permissions of other mailboxes through the permissions assigned to other users on each user's mailbox.

    We could run the following script to get the permission between user mailbox:

    Full Access:

    $mailboxes = Get-Mailbox -ResultSize Unlimited -Filter ('RecipientTypeDetails -eq "UserMailbox"')  
      
    foreach ($mailbox in $mailboxes)   
    { Get-MailboxPermission -Identity $mailbox.alias -ResultSize Unlimited | ?{($_.IsInherited -eq $false) -and ($_.User -ne "NT AUTHORITY\SELF") -and ($_.AccessRights -like "FullAccess")} | select Identity, User, AccessRights }  
    

    Send As:

    $mailboxes = Get-Mailbox -ResultSize Unlimited -Filter ('RecipientTypeDetails -eq "UserMailbox"')  
      
    foreach ($mailbox in $mailboxes)   
    { Get-ADPermission -Identity $mailbox.alias | ? { $_.ExtendedRights -like "*send*" -and -not ($_.User -match "NT AUTHORITY") -and ($_.IsInherited -eq $false)} | select Identity,User,ExtendedRights }  
    

    Send On Behalf:

    Get-Mailbox -ResultSize Unlimited -Filter ('RecipientTypeDetails -eq "UserMailbox"') | select Alias, GrantSendOnBehalfTo  
    

    The following screenshots in the test in lab environment:
    Full Access:
    95116-image.png

    Send As:
    95094-image.png

    Send On Behalf:
    95141-image.png

    ----------

    If the response 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.

    3 people found this answer helpful.

  2. Wouter Victor 16 Reputation points
    2024-02-15T16:16:58.7033333+00:00

    The one for SendAs in Exchange online is the following. Code below for shared mailboxes

    $mailboxes = Get-Mailbox -ResultSize Unlimited -Filter ('RecipientTypeDetails -eq "SharedMailbox"')  
    foreach ($mailbox in $mailboxes)   
    { Get-RecipientPermission -Identity $mailbox.alias | Where-Object { $_.AccessRights -like "*send*" -and -not ($_.Trustee -match "NT AUTHORITY") -and ($_.IsInherited -eq $false)} | select Identity,Trustee,AccessRights }
    
    
    
    0 comments No comments