question

wisikm-7176 avatar image
0 Votes"
wisikm-7176 asked RichMatheisen-8856 commented

Set-DistributionGroup -BypassModerationFromSendersOrMembers {add=""} does not work

Simple command:

Set-DistributionGroup mitarbeiter-xx -BypassModerationFromSendersOrMembers @{add="mitarbeiter-xx"}

With this command the members of the distribution group are added to the bypass of the moderation of this group. This command delivers no error message BUT it simply deletes every existing bypass entry AND doesn't add itself. If the command is used normally without @{add= then the command works but it replaces instead of adding so it isn't useful for my purpose because I need to add members via batch to several groups.

Via ECP I can do this without any harm.

Same syntax with -moderatedby is also working like expected so I don't seem to have an error in my command.

This should both work like described here: https://docs.microsoft.com/de-de/exchange/recipients-in-exchange-online/moderated-recipients-exo/configure-moderated-recipients-exo

Maybe someone could test it on his side if the same thing happens. We are using Exchange 2016 on premise.

windows-server-powershelloffice-exchange-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

michev avatar image
0 Votes"
michev answered

Seems to work fine here, though I only tested it against Exchange Online.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndyDavid avatar image
0 Votes"
AndyDavid answered AndyDavid commented

Yes, I have seen this in the past on-prem.
It clears the entire list. - even if I try different ways to add via PS.



· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

On which systems? Also 2016 or 2019, too?

If it doesn't work like it is described in the officiall powershell documentation it should be fixed by Microsoft...!

0 Votes 0 ·

Have you tried updating the property directly? I don't have an on-prem Exchange organization to try it, but if the property is a list of SMTP addresses (or legacyExchangeDN or distinguished names) you may be able to update (or recreate) the property and then use Set-DistributionGroup to supply the new list.

0 Votes 0 ·

Hey Rich, tried that to, no go :(

0 Votes 0 ·
Show more comments
KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered

@wisikm-7176

I have tested it with Exchange 2013 CU23, Exchange 2016 CU 14, CU 20, CU 21, Exchange 2019 CU 10, both of them have this phenomenon.

Thanks for your sharing, I am in further confirmation, if there is relevant information, I will update here.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

wisikm-7176 avatar image
0 Votes"
wisikm-7176 answered RichMatheisen-8856 commented

Ok, thanks to another guy I could solve it by a workaround:

Get-DistributionGroup | where {$.alias -like "mitarbeiter-*"} | foreach {
$bypassModFrom = @((Get-DistributionGroup $
.alias).BypassModerationFromSendersOrMembers.DistinguishedName)
$bypassModFrom += (Get-Recipient sekretariat).DistinguishedName
$bypassModFrom += (Get-Recipient x1).DistinguishedName
$bypassModFrom += (Get-Recipient x2).DistinguishedName
$bypassModFrom += (Get-Recipient x@y.com).DistinguishedName
Get-DistributionGroup $_.alias | Set-DistributionGroup -BypassModerationFromSendersOrMembers ($bypassModFrom | Select-Object -Unique)
}

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That looks like what I'd suggested doing earlier!

0 Votes 0 ·