0

I'm working on sort-of a script for creating new DGs in exchange online powershell. But I miss some of the parameters (and can't find them on technet) for the command.

so in a nutshell, i use command New-DistributionGroup. I know how to do most of the tasks, that I need. But I can't figure out, how to do 3 of them (and I apologise, if I name something wrong - my exchange gui is in polish, so I'm translating back to english):

1) hide the group from address list. this is disabled by default, how do I enable it with powershell?

2) who can send messages to the group (is it open only for internal use or for everyone, even from outside of the organisation), this is restricted for internal by default

3) how do i change the default domain in address for the group? ex. if i create group ADMINS on my tennant, it would by default create with COMPANY.ONMICROSOFT.COM sufix. how do i change it to be COMPANY.COM, and maybe for some other groups something like COMPANY.PL, COMPANY.DE etc? should I do it with primarySMTPAddress parameter? If yes, then could you please bring an example?

EDIT:

just in case - if that's nercessary, I'm ok with running two commands - one for creating a group and second (or more) to modify it.

kjubus
  • 145
  • 1
  • 9

1 Answers1

0

You need to use the Set-DistributionGroup CMDlet command, the syntax for it is:

Set-DistributionGroup -Identity <DistributionGroupIdParameter>
  1. Hide the group from address list: [-HiddenFromAddressListsEnabled <$true | $false>]
  2. Who can send messages to the group: There is a lot of options here:

    • You can accept from a list: [-AcceptMessagesOnlyFrom <MultiValuedProperty>] [-AcceptMessagesOnlyFromDLMembers <MultiValuedProperty>] [-AcceptMessagesOnlyFromSendersOrMembers <MultiValuedProperty>]
    • You can also block messages [-RejectMessagesFrom <MultiValuedProperty>] [-RejectMessagesFromDLMembers <MultiValuedProperty>] [-RejectMessagesFromSendersOrMembers <MultiValuedProperty>]
    • And finally require authentication from sender if needed [-RequireSenderAuthenticationEnabled <$true | $false>]
  3. Change the default domain in address for the group: [-PrimarySmtpAddress <SmtpAddress>]

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

Noor Khaldi
  • 3,829
  • 3
  • 18
  • 28
  • Wow, that helps a lot. I did expect that I might not be able to do it when creating a DG. about the second part, who can send messages to the group - I would like to know which command (parameter) changes that simple toggle in GUI (where you have those 2 options I mentioned in "delivery managing", if I translate it correctly). That would really help me, if there is either a parameter for toggling between or different parameter for one or the other. at worst - if there is a parameter that would open it up for external emails (it's restricted by default) – kjubus Feb 14 '18 at 14:34
  • The options under "Delivery Management" are controlled using The RequireSenderAuthenticationEnabled parameter specifies whether to accept messages only from authenticated (internal) senders. Valid values are: $true Messages are accepted only from authenticated (internal) senders. Messages from unauthenticated (external) senders are rejected. $false Messages are accepted from authenticated (internal) and unauthenticated (external) senders. – Noor Khaldi Feb 14 '18 at 20:11