Thursday, 21 January 2016

Set Send As Permission Office 365 using Powershell

We can set or grant send as permission for an office 365 mailbox using the powershell cmdlet Add-RecipientPermission .

Note: Before proceed, Connect Exchange Online Remote PowerShell.

Run the following command to grant send as permission to Morgan on the user Kevin’s mailbox.
Add-RecipientPermission Kevin -Trustee Morgan -AccessRights SendAs -Confirm:$False
Trustee - The mailbox that should be granted the send as permission.

Set Send As Permissions for Bulk Mailboxes from Text file

Use the below powershell script to configure Send As permission for bulk office 365 mailboxes from text file. First create the text file Mailboxes.txt which includes one mailbox in each line.
Get-Content C:\Mailboxes.txt | ForEach-Object{
 $mailbox = $_
 Add-RecipientPermission $mailbox -Trustee <user> -AccessRights SendAs -Confirm:$False

Grant Send As access to all Mailboxes in Office 365

Use the below powershell script to configure send as permission for all the mailbox users in your Office 365.
$MBXS = Get-Recipient -RecipientType UsermMilbox 
ForEach ($MBX in $MBXS) 
Add-RecipientPermission $ -AccessRights SendAs –Trustee <user> -Confirm:$False 

List all send as permissions

If you want to list all the configured send as permissions, use the below command.
Get-RecipientPermission | Where {($_.Trustee -ne 'nt authority\self') -and ($_.Trustee -ne 'null sid')}


No comments:

Post a Comment