This is another blog post about Microsoft 365 and Exchange Online. This time I will dedicate myself to a feature that is Outlook and Exchange related. What I am talking about is granting mailbox Send and SendAs permissions. Do you have an overview of what is going on in your environment and foremost who has granted send or sendas permissons to other users? If not, read on.
Connect to Exchange Online
First of all we need to connect to Exchange Online. Hit the keys and enter the following lines to connect to your tenant.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange ` -ConnectionUri https://outlook.office365.com/powershell-liveid/ ` -Credential (Get-Credential) -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking
How do you know that worked? You should see a screen that shows exported commands.
Retrieve a list of all Send and SendAs Permissions
Type the following code to get a list of all user mailboxes that have send or sendAs rights configured:
Get-Mailbox -ResultSize Unlimited | Get-RecipientPermission | Where-Object {$_.Trustee -notlike "*self*"}
Nice one. As you can see, I have SendAs permissons on hubers mailbox 😉
Hope this was helpful!
See also
Microsoft 365: Show Mailboxes that have Auto-Reply enabled
Microsoft 365: Add User Accounts and Mailboxes with PowerShell
Categories: Microsoft 365, PowerShell
Hi Patrick,
I have 2 points on your post. First of all you should have a look onto the new Exchange Online Powershell Module V2 (see https://docs.microsoft.com/de-de/powershell/exchange/exchange-online/exchange-online-powershell-v2/exchange-online-powershell-v2?view=exchange-ps). Using the new module will save you some code for connecting to Exchange Online and you are able to use the new commandlets. Another comment: Your code would work in small environments but will fail in bigger environments. Additionally in some cases it might be helpful to check the Send-On-Behalf permissions too.
Regards,
Roland
LikeLiked by 1 person
Thank you for this hint. Some things are pretty easy if you catch them.
Cheers, Henning
https://www.henning-uhle.eu/
LikeLike