Creating Dynamic Distribution Groups for Live@edu via Windows PowerShell (Part 2)

<img style="background-image: none; margin: 0px 0px 0px 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;" title="spam" alt="spam" src=" part 1 of this guide I covered how to create a DDG that sent mail to users that had “Parent” in their CustomAttribute1 field. I also described how to test the DDG to ensure that the right users had been added.

In this part I’ll cover how to restrict access to the DDG. Sending mass emails to parents is not an uncommon event, but what if you want to moderate emails before they’re allowed to be sent? What if you want the DDG to be hidden from all your users to prevent misuse?

1. Hide DDG from the GAL

We can modify our existing “All Parents” group by using the following code that will remove it from the GAL:

Set-DynamicDistributionGroup "All Parents" –HiddenFromAddressListsEnabled $true

You can re-enable visibility in the GAL by changing $true to $false.

2. Enable moderation

The following code will turn moderation on, set the DDG moderator to a user whose alias is james, and send notifications only to internal senders whose mail is rejected by the moderator.

Set-DynamicDistributionGroup "All Parents" –ModerationEnabled $true –ModeratedBy james -SendModerationNotifications Internal

Any mail that is sent to the “All Parents” DDG now has to be manually moderated before it is passed on to the recipients.

More information on the additional parameters you can use with Dynamic Distribution Groups can be found on the Outlook Live help website.

Creating Dynamic Distribution Groups for Live@edu via Windows PowerShell (Part 1)

Following on from my previous post detailing the options for sending mass mails, I thought it would be useful to post the PowerShell code I’ve used in the past to create, and test, DDGs.

powershellDDGs, rather than store a set list of recipients, will mail users who satisfy the criteria upon which the group is based. There are a variety of attributes you can use, such as CustomAttributeX (where X is a number 1 to 15). I’ve included some sample steps:


1. Create new dynamic distribution group:

New-DynamicDistributionGroup "All Parents" -IncludedRecipients MailboxUsers, MailContacts –ConditionalCustomAttribute1 Parent

This code creates a new DDG called “All Parents” ( and includes your mailbox users and external contacts in the search on CustomAttribute1, which in this case looks for “Parent”.

2. Test DDG criteria:

$DDG = Get-DynamicDistributionGroup "All Parents";
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter

This code will display all the users the DDG would mail if you were to send a message to it. You should see all users who have “Parent” in CustomAttribute1 listed.

It is important to consider setting restrictions on who can mail the DDG – by default it cannot be mailed from outside of your Outlook Live domain; however unless you specifically set it your DDG will be visible in the GAL and “mailable” by all your users.

For information on hiding and moderating your DDGs, read part 2!

Dynamic Distribution Groups in Live@edu

Sending an email to lots of users is not just the preserve of spam bots and marketers it’s also something people need to do with perfect legitimacy. Take, for example, the warden for a university halls of residence who may want to email all his resident students to welcome them to their new home for the year, or the head teacher who needs to email all the students in a school to tell them about the school sports day this summer…

In a medium to large institution this could easily run into the tens-of-thousands of recipients, but with limitations on the number of emails that can be sent from a Live@edu account in one day (500, in case you were wondering!) – what’s the best way to do it?

In this blog post I will cover two ways to achieve a successful ‘mass mail’:

1. On-Premises Exchange

IMAG0003The first, and simplest, answer is to maintain an on-premises mail server to handle these big mail-shots. As the server is locally hosted and administered it doesn’t fall under the limitations of the Live@edu mail service and therefore can send as many emails as the institution defines as its limit.

There are some considerations for adopting this method:

  • Whitelisting the server is a must. Failing to do so with Live@edu may result in your local mail server being blocked for spam; resulting in several days of interrupted service as it can take up to three business days to unblock an IP address.
  • This method is not particularly dynamic.
  • This method is not free as it requires the continued maintenance of a local mail server. Depending on your deployment, and requirements, this may be an issue.

2. Dynamic Distribution Groups

Cloud_in_the_sunlightDynamic Distribution Groups (DDGs) are my current class favourite. Dynamic in name and nature this wonderful distribution group type allows a practically limitless number of recipients to receive email.

Unlike a standard distribution group where a mail sent to a group containing 25 recipients would count as 25 separate emails, a DDG calculates the recipients on the fly determining who should be sent the email based on a set of criteria specified when the DDG is created. So a DDG that would result in 500 people being emailed would still only count as 1 email.

Food for thought:

  • DDGs check the recipients every time you send an email, so if a new person who would be eligible for the email joins the GAL then they will receive it automatically.
  • DDGs can include external mail contacts.
  • DDGs can be hidden from the GAL.
  • Security – who can send to the DDG – can be applied to prevent abuse.

Further reading: