How to create a new dynamic distribution groups in Exchange Online

This article explains the procedure to create dynamic distribution group in Exchange Online or Office 365 using PowerShell and ADManager Plus, a unified Active Directory, Office 365 and Exchange management and reporting tool, to demonstrate why the latter is the simpler and easier of the two.

Windows PowerShell

Steps to use PowerShell to create a new dynamic distribution group.

  • Ensure you have the necessary permissions to create distribution groups.
  • Get the values for all necessary attributes viz., Name, Alias, RecipientFilter etc.
  • Check if you have permission to configure all the attributes
  • Create the script with these values, and execute it in the PowerShell window.

A sample script to create an Exchange Online dynamic distribution group using PowerShell

 Copied
New-DynamicDistributionGroup -Name "Branding Campaign Team" --RecipientFilter "(RecipientType -eq 'UserMailbox') -and (Department -like 'Marketing*' -or Department -like 'Sales*')" -RecipientContainer "India"
Click to copy entire script

ADManager Plus

To create a dynamic Distribution group in Exchange Online:

  • Select the Create Dynamic Distribution Groups option from Group Management in Office 365 tab.
  • Select the desired Office 365 tenant, select the CSV file with the details of distribution groups to be created, and click Create.

Screenshot

Create Office 365 Dynamic Distribution Groups using ADManager plus

» Start 30-day Free Trial

The PowerShell script mentioned above will create new dynamic distribution group named Branding Campaign Team, and will include users from marketing and sales department in India OU.

Limitations of creating dynamic distribution groups using PowerShell in Office 365 or Exchange Online.

  • You will not be able to create distribution group using PowerShell unless you have the necessary permissions to create a distribution group, and also configure all the attributes used in the script. With ADManager Plus, users' privileges in native AD or Exchange doesn't have to be elevated, and they can be allowed to do this operation only in specific OUs or domains.
  • To create the group with different conditions or configure any other attributes of the dynamic distribution group, the script has to be modified or created again from scratch. With ADManger Plus, all properties can be configured at once.
  • To bulk create dynamic distribution groups in Exchange Online or Office 365 from CSV, the script has to be modified. With ADManager Plus though, it is offered as a built-in option that's available by default.
  • You must know how to run the scripts from the PowerShell window or command line. ADManager Plus is purely GUI-based, allowing you to perform all management and reporting actions with just mouse clicks from its web-based console.
  • Even a misplaced hyphen, a typo in the LDAP names or lack of sufficient permission to configure any of the attributes used in the script will lead to errors. As all actions in ADManager Plus are GUI-driven, there is no need to write scripts, eliminating the chances of errors.

Single-window mailbox management for Exchange and Office 365 with ADManager Plus.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
     
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link