Share via

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

Mohammad 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 | 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.

0 comments No comments

3 answers

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

    Hi @Mohammad 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.

    6 people found this answer helpful.

  2. Wouter Victor 31 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 }
    
    
    
    1 person found this answer helpful.
    0 comments No comments

  3. M Dwight Snow 5 Reputation points
    2024-09-09T21:43:09.7066667+00:00

    How can we then export to csv.

    Melvi

    0 comments No comments

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.