Remove Send on Behalf permissions using Powershell

We can remove send on behalf permission from a exchange mailbox user using the powershell cmdlet Set-Mailbox with the parameter GrantSendOnBehalfTo. Use the below command to remove send on behalf permission.

Set-Mailbox "[Identity]" -GrantSendOnBehalfTo @{remove="[User]"}

[Identity] – The name of the mailbox user from the send on behalf permission to be removed.
[User] – The user that has send on behalf permission.

The following command removes send on behalf permission of the user “Morgan” from Kevin’s mailbox.

Set-Mailbox "Kevin" -GrantSendOnBehalfTo @{remove="Morgan"}

You can also remove permission for multiple users by giving user names as comma separated values.

Set-Mailbox "Kevin" -GrantSendOnBehalfTo @{remove="User1","User2"}

You can check the final permissions by using below command.

Get-Mailbox "Kevin" | Select -ExpandProperty GrantSendOnBehalfTo | Select Name,Parent

Remove Send-on-Behalf permission for multiple user mailboxes

We can use the exchange management powershell cmdlet Get-Mailbox to get specific set of user mailboxes and pipe the results to Set-Mailbox cmdlet. The following command removes send on behalf permission of the user “Morgan” from all the mailboxes.

Get-Mailbox | Set-Mailbox -GrantSendOnBehalfTo @{remove="Morgan"}

You can also apply filters in Get-Mailbox cmdlet to select particular set of users. The following command select mailbox users from TestOU and pipe the results to Set-Mailbox cmdlet to remove send on behalf rights.

Get-Mailbox | Where {$_.DistinguishedName -like "*OU=TestOU,DC=TestDomain,DC=com*"} |
Set-Mailbox -GrantSendOnBehalfTo @{remove="User1","User2"}
Advertisement

Leave a Comment