Friday, 28 August 2015

Grant Send on Behalf Permissions using Powershell

We can set or grant send on behalf permission for a exchange mailbox user using the powershell cmdlet Set-Mailbox with the parameter GrantSendOnBehalfTo. Use the below command to set send on behalf permission.
Set-Mailbox "[Identity]" -GrantSendOnBehalfTo @{add="[User]"}
[Identity] - The name of the mailbox user on which the send on behalf permission to be added.
[User] - The user to be granted the send on behalf permission.

The following command grants "Morgan" send on behalf permission to Kevin’s mailbox.
Set-Mailbox "Kevin" -GrantSendOnBehalfTo @{add="Morgan"}
You can also grant permission for multiple users by giving user names as comma separated values.
Set-Mailbox "Kevin" -GrantSendOnBehalfTo @{add="User1","User2"}
The above commands add permission with existing send on behalf permissions and it does not overwrite the existing permissions (this is required for most cases). You can check the applied permissions by using below command.
Get-Mailbox "Kevin" | Select -ExpandProperty GrantSendOnBehalfTo | Select Name,Parent

Grant 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 grants send on behalf permission for "Morgan" to all the mailboxes.
Get-Mailbox | Set-Mailbox -GrantSendOnBehalfTo @{add="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 set send on behalf rights.
Get-Mailbox | Where {$_.DistinguishedName -like "*OU=TestOU,DC=TestDomain,DC=com*"} |
Set-Mailbox -GrantSendOnBehalfTo @{add="User1","User2"}


Advertisements
Advertisements

No comments:

Post a Comment