Dynamic Distribution Groups


When wanting to create Dynamic Groups in bulk such as you may do when migrating to Office 365. Using powershell can be very useful and likely necessary to be ableĀ  to use other attributes. So, creating a simple .CSV file will come in handy. I have an example below.


$CSV | foreach {new-dynamicdistributiongroup -name $_.displayname -alias $_.alias -primarysmtpaddress $_.primarysmtpaddress -RecipientFilter $_.RecipientFilter }

Anyone trying to make Dynamic Distribution Groups may be confused; despite being able to export a Group with the -not operatorĀ  it doesn’t appear that you can use the -not operator when creating or editing a group ; as a work around using -ne seems to work.
-and (-not(Office -like ‘shared services*’
-and (Office -ne ‘shared services*’
This mentions the available operators; despite only referencing Exchange on-premise: