Add Send As permission to all users in Office 365

The following will show you how to grant SendAs permission to all recipients in Office 365 Exchange Online. This is for two recipient types, mail users and user mailboxes in the situation where you have directory synchronization turned on and an Exchange hybrid setup.

First things first, connect to the Office 365 Exchange Online remote PowerShell:

Import-module msonline
$LiveCred=Get-Credential
Connect-MsolService –Credential $LiveCred

Run the following 3 commands to connect Windows PowerShell to the Office 365 exchange service:

  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ –Credential $LiveCred -Authentication Basic –AllowRedirection
  • Import-PSSession $Session (If you get an error with this cmdlet, run this Set-ExecutionPolicy Unrestricted)

To grant SendAs permissions to either a group or user, e.g. smtp.user, run the following command. This will grant SendAs permission to smtp.user for all recipient types, mail users and user mailboxes.

Get-Recipient | Where-Object {($_.RecipientType -eq “MailUser”) -or ($_.RecipientType -eq “UserMailbox”)} | Add-RecipientPermission -AccessRights SendAs -Trustee “smtp.user”

Leave a comment