/commands/exchange-online/grant-fullaccess-sendas-sendonbehalf
Exchange Online: grant FullAccess, SendAs and SendOnBehalf permissions with PowerShell
- tool
- Exchange Online PowerShell
- versions
- Exchange Online, ExchangeOnlineManagement 3.x
- os
- windows, linux, macos
The three mailbox delegation permissions in Exchange Online are set with three different cmdlets. Connect with Connect-ExchangeOnline first; you need a role that includes these cmdlets (for example the Recipient Management role group or the Exchange Recipient Administrator role).
# Full Access: open the mailbox and read everything in it
Add-MailboxPermission -Identity sales@contoso.com -User anna@contoso.com -AccessRights FullAccess -InheritanceType All
# Send As: send mail that appears to come from the mailbox itself
Add-RecipientPermission -Identity sales@contoso.com -AccessRights SendAs -Trustee anna@contoso.com
# Send on Behalf: "Anna on behalf of Sales"
Set-Mailbox -Identity sales@contoso.com -GrantSendOnBehalfTo @{Add="anna@contoso.com"}Add-RecipientPermission asks for confirmation; add -Confirm:$false in scripts.
The three permissions
| Permission | Add | Check | Remove |
|---|---|---|---|
| FullAccess | Add-MailboxPermission -AccessRights FullAccess -User | Get-EXOMailboxPermission -Identity MBX | Remove-MailboxPermission -AccessRights FullAccess -User |
| SendAs | Add-RecipientPermission -AccessRights SendAs -Trustee | Get-EXORecipientPermission -Identity MBX | Remove-RecipientPermission -AccessRights SendAs -Trustee |
| SendOnBehalf | Set-Mailbox -GrantSendOnBehalfTo @{Add="user"} | (Get-EXOMailbox MBX -Properties GrantSendOnBehalfTo).GrantSendOnBehalfTo | Set-Mailbox -GrantSendOnBehalfTo @{Remove="user"} |
MBX stands for the mailbox you are changing. -GrantSendOnBehalfTo user1,user2 without @{Add=...} replaces the whole list; use the @{Add=...; Remove=...} form to change one entry.
FullAccess and Outlook auto-mapping
By default (-AutoMapping $true) Outlook adds the mailbox to the user's profile automatically. To grant access without auto-mapping:
Add-MailboxPermission -Identity sales@contoso.com -User anna@contoso.com -AccessRights FullAccess -InheritanceType All -AutoMapping $falseAuto-mapping does not work when the permission is granted to a security group, and it cannot be switched off for an existing grant: remove the permission with Remove-MailboxPermission and add it again with -AutoMapping $false.
In Exchange Online, FullAccess also gives access to calendar items marked Private. A mailbox can hold at most 500 permission entries; for more users, grant the permission to a mail-enabled security group.
Copies of sent items
When a delegate sends as or on behalf of a shared mailbox, the message is saved in the delegate's Sent Items only. To also keep a copy in the shared mailbox:
Set-Mailbox -Identity sales@contoso.com -MessageCopyForSentAsEnabled $true -MessageCopyForSendOnBehalfEnabled $trueSources
- learn.microsoft.comlearn.microsoft.com/en-us/powershell/module/exchangepowershell/add-mailboxpermission
- learn.microsoft.comlearn.microsoft.com/en-us/powershell/module/exchangepowershell/add-recipientpermission
- learn.microsoft.comlearn.microsoft.com/en-us/powershell/module/exchangepowershell/set-mailbox
- learn.microsoft.comlearn.microsoft.com/en-us/exchange/recipients-in-exchange-online/manage-permissions-for-recipients