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.

ddl

$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.
Example:
-and (-not(Office -like ‘shared services*’
-and (Office -ne ‘shared services*’
This mentions the available operators; despite only referencing Exchange on-premise:
https://technet.microsoft.com/en-us/library/bb125127(v=exchg.160).aspx

Advertisements