Importing members in a Distribution Group

This topic contains 6 replies, has 4 voices, and was last updated by Profile photo of David Schmidtberger David Schmidtberger 5 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38012
    Profile photo of Insan Mohamed
    Insan Mohamed
    Participant

    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"

    thanks

    #38030
    Profile photo of Richard Diphoorn
    Richard Diphoorn
    Participant

    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!

    #38031
    Profile photo of Mark Prior
    Mark Prior
    Participant
    $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)

    #38122
    Profile photo of Insan Mohamed
    Insan Mohamed
    Participant

    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

    thanks

    #38127

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

    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="",""...}.

    https://technet.microsoft.com/en-us/library/bb124955(v=exchg.160).aspx

    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

    #38184
    Profile photo of Insan Mohamed
    Insan Mohamed
    Participant

    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

    thanks

    #38185

    take a look here:
    https://technet.microsoft.com/en-us/library/jj983442(v=exchg.150).aspx

    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
    Alias
    Distinguished name (DN)
    Canonical DN
    Email address
    GUID

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.