Author Posts

April 19, 2016 at 12:25 pm

Just a gentle request

Is there a script that will import members in a distribution group ? these members will have to be imported in the section 'message approval' as "Senders who don't require message approval"


April 19, 2016 at 11:03 pm

It could be that there's a script floating around on the internet. But.... did you do a search yourself? Have you tried to create a script on your own? If so, we're happy to help!

April 19, 2016 at 11:46 pm

$Users = Get-Content C:\Users.txt
$Groups = Get-Content C:\groups.txt
ForEach ($Group in $Groups) {
   Set-DistributionGroup $Group -AcceptMessagesOnlyFrom((Get-DistributionGroup $Group).AcceptMessagesOnlyFrom + $Users)

Users.txt needs to contain the Alias or Samaccountname of users
groups.txt needs to contain the alias of group(s)

April 21, 2016 at 10:15 am

Dear Mr. Prior:

Just a gentle note of thanks; incidentally, I wasn't clear on the objective of the script please, note the revised information

The script should allow a list of users to "ByPassTheModerator" when sending email

much appreciated


April 21, 2016 at 10:58 am

Insan, if you read through the technet on set-distributiongroup, and search the page for moderator you will see:

as far as how to add them to this list, it really depends on exactly what you want to add, the example in the technet is pretty self-explanatory:
To enter multiple senders and overwrite any existing entries, use the following syntax: ,.... If the values contain spaces or otherwise require quotation marks, use the following syntax: "",""....
To add or remove one or more senders without affecting any existing entries, use the following syntax: @{Add="",""...; Remove="",""...}.

i don't have free time today to try and bash out a functioning script but with the information provided in the tech-net, and Mark's example, it shouldn't be to bad

April 22, 2016 at 11:11 am

Thanks, Mr. David Schmidtberger:

It's giving me a hard time please, see below:

Set-DistributionGroup -identity "traffic" -ModerationEnabled $true -ModeratedBy "test1" -BypassModerationFromSendersOrMembers @{ADD ="test2"}

1) moderation enabled – OK

2) ModeratedBy – OK

3) @{ADD ="test2"} this is not working it doesn't add any accounts – tried with email address, alias, first name and last name

4) manually added test2

5) rerun this command
Set-DistributionGroup -identity "traffic" -ModerationEnabled $true -ModeratedBy "test1" -BypassModerationFromSendersOrMembers @{ADD ="test2"}

6) Result test2 was removed


April 22, 2016 at 11:32 am

take a look here:

there are examples of what you want to do.

i've never personally set this attribute, but combined with the set-distributiongroup technet, it looks like it accepts the following: Name
Display name
Distinguished name (DN)
Canonical DN
Email address