0

I have one Distribution Group TestDG and three mailboxes mb01, mb02, mb03. I want to give Send on Behalf Permission on a Distribution Group to these 3 mailboxes.

I've tried to set it like below for every mailbox but next one always overrides the previous one.

Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo mb01
Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo mb02
Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo mb03

Is it possible to give this permission to multiple mailboxes? if there is a way to do this I'd really appreciate any help!

Sylca
  • 161
  • 2
  • 10

1 Answers1

2

According to the Technet documentation for the Set-DistributionGroup cmdlet, the GrantSendOnBehalfTo parameter takes an argument of type Microsoft.Exchange.Data.MultiValuedProperty.

As outlined by PowerShell MVP Shay Levy in this article, any MultiValuedProperty can take partial updates in the form of a HashTable containing values that you want to Add or Remove, like so:

Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo @{"Add"="mb01","mb02"}
Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo @{"Add"="mb03"}

Each update will add the target to the list of "Send on Behalf" grantees, without overwriting the previous values.

Similarly, you can remove single values with the same technique:

Set-DistributionGroup "TestDG" -GrantSendOnBehalfTo @{"Remove"="mb02"}
Mathias R. Jessen
  • 25,161
  • 4
  • 63
  • 95