Tuesday, March 21, 2017

Export the Members of Exchange Dynamic Distribution Group

I received the email from one of my friend asking how to extract the Dynamic Distribution Group Membership details from Exchange, as you know we cannot extract the data using Exchange Management console as we do for regular mailbox export list, but we can use Exchange Management Shell to extract the data.

Step 1: - Get details of Dynamic Distribution Group

Ideally, we need to find what attribute entry used to setup the Dynamic Distribution Group and the parameter, in the below example we have LDAPRecipientFilter parameter used the connection with “Location” attribute to setup.

Get-DynamicDistributionGroup -Identity "/CMLTFALL2@learnexchange.info" | fl

RunspaceId                             : c3966317-166a-4aa5-8d28-d58eeb6ec871

RecipientContainer                     : learnexchange.info

RecipientFilter                        :

LdapRecipientFilter                    : (&(!cn=SystemMailbox{*})(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))(objectCategory=user)(l=Little Falls))))

IncludedRecipients                     :

ConditionalDepartment                  : {}

ConditionalCompany                     : {}

ConditionalStateOrProvince             : {}

ConditionalCustomAttribute1            : {}

Step 2: - Get details of Mail Recipient

Now, we need to extract the recipient details from above Dynamic Distribution Group so we will use Get-Recipient cmd.

Get-Recipient –Identity Gengaiyan@learnexchange.info | FL

Step 3 Export Dynamic Distribution Group: -

Pick-up the parameter that you want while exporting the member details from Dynamic Distribution Group, like Display Name, PrimarySMTPAddress, Title, Database

$Dy=Get-DynamicDistributionGroup -Identity "/CMLTFALL2@learnexchange.info"

Get-Recipient -RecipientPreviewFilter $Dy.LdapRecipientFilter | select DisplayName,primarysmtpaddress | Export-Csv C:\temp\DynamicGroup.csv -NoTypeInformation

Thanks for Visiting. Keep watch for the further updates!