Changing Send On Behalf setting in Exchange 2010 / Exchange 2013 or Exchange 2016 is quite simple task that can be easily done from GUI. It gets a bit more complicated when you try to add/change Send On Behalf rights from PowerShell.
Changing Send On Behalf setting in Exchange 2010 / Exchange 2013 or Exchange 2016 is quite simple task that can be easily done from GUI. It gets a bit more complicated when you try to add/change Send On Behalf rights from PowerShell.
Usually most people will go for
Set-Mailbox <UserToAddPermissionsTo> -GrantSendOnBehalf <UserToGivePermissionsTo>
It's a simple command but it actually does a very dangerous thing… it overwrites current GrantSendOnBehalf permissions. While it's not a problem when it's first time you set it up, it's a big deal when there are already multiple people added to GrantSendOnBehalf field.
Fortunately there's a simple way to do this to not overwrite this setting. Below you can find couple of commands that should make your life simpler.
function Add-DistributionListGrantSendOnBehalfTo { Param($newTrustee, $targetDistributionGroup) Set-DistributionGroup $targetDistributionGroup -GrantSendOnBehalfTo @{add=$newTrustee} } function Remove-DistributionListGrantSendOnBehalfTo { Param($oldTrustee, $targetDistributionGroup) Set-DistributionGroup $targetDistributionGroup -GrantSendOnBehalfTo @{remove=$oldTrustee} } function Replace-DistributionListGrantSendOnBehalfTo { Param($oldTrustee, $newTrustee, $targetDistributionGroup) Set-DistributionGroup $targetDistributionGroup -GrantSendOnBehalfTo @{add=$newTrustee} Set-DistributionGroup $targetDistributionGroup -GrantSendOnBehalfTo @{remove=$oldTrustee} } function Remove-MailboxGrantSendOnBehalfTo { Param($oldTrustee, $targetMailbox) Set-Mailbox $targetMailbox -GrantSendOnBehalfTo @{remove=$oldTrustee} } function Add-MailboxGrantSendOnBehalfTo { Param($newTrustee, $targetMailbox) Set-Mailbox $targetMailbox -GrantSendOnBehalfTo @{add=$newTrustee} } function Replace-MailboxGrantSendOnBehalfTo { Param($oldTrustee, $newTrustee, $targetMailbox) Set-Mailbox $targetMailbox -GrantSendOnBehalfTo @{remove=$oldTrustee} Set-Mailbox $targetMailbox -GrantSendOnBehalfTo @{add=$newTrustee} }
Simple usage of Exchange PowerShell commands from above:
Add-MailboxGrantSendOnBehalfTo -NewTrustee <AllowedUserToSendOnBehalf> -TargetMailbox <UserMailboxToManage> Replace-MailboxGrantSendOnBehalfTo -NewTrustee <AllowedUserToSendOnBehalf> -OldTrustee <ReplacedUserToSendOnBehalf> -TargetMailbox <UserMailboxToManage> Remove-MailboxGrantSendOnBehalfTo -OldTrustee <ReplacedUserToSendOnBehalf> -TargetMailbox <UserMailboxToManage>
This post was last modified on June 6, 2025 20:34
Ever wondered how to run network diagnostics like Ping, Traceroute, or DNS queries from probes…
Are you tired of manually running network diagnostics like Ping, Traceroute, or DNS queries? The…
Discover new features in the PSWriteHTML PowerShell module – including New-HTMLInfoCard, improved layout controls with…
Security Identifier (SID) History is a useful mechanism in Active Directory (AD) migrations. It allows…
Today, I made the decision to upgrade my test environment and update the version of…
Have you ever looked at your Active Directory and wondered, "Why do I still have…