• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Paris, France
  • 6. Bangalore, India
  • 7. Amsterdam, Netherlands
  • 8. San Francisco, CA
  • 9. Hong Kong
  • 10. Houston, TX

Wednesday, May 30, 2007

 

View membership of a Dynamic Distribution Group

Posted by Bharat Suneja at 3:41 PM
Dynamic Distribution Group is the Exchange Server 2007 term for Query-Based Distribution Groups supported by Active Directory (and therefore Exchange Server 2003/2000) in Windows Server 2003. Unlike normal security and distribution groups, which have their membership defined by manually adding users/recipients as members, the membership of a Dynamic Distribution Group is determined every time the group receives a message. The (SMTP) Transport's Categorizer component queries a Global Catalog for a list of recipients matching the LDAP filter defined in the group.

Windows Server 2003's ADUC console allows you to preview recipients returned by the filter, by going to the group's properties and clicking Preview. However, with recipient management moved to Exchange in Exchange 2007, this ability to preview is limited to groups created using Exchange's "pre-canned" filters. If you're using a custom recipient filter (Exchange 2007 uses OPATH filters), you can't preview the recipients returned using the console.



In a previous post titled "Adventures with OPATH: some annoyances if you're used to LDAP", I talked about previewing membership using the Saved Queries feature in ADUC (the Windows 2003 version).

Later I noticed the product documentation was updated to include a way to view which recipients get picked up by the recipient filter - this is easily accomplished from the shell, using the following commands:

$Group = Get-DynamicDistributionGroup -Identity "My Dynamic Group"

This stores the Dynamic Distribution Group in a variable called $Group. Now we can use the Get-Recipient command and filter the output using the recipient filter from the variable $Group

Get-Recipient -Filter $Group.RecipientFilter

Labels: , , ,

8 Comments:

June 25, 2007 5:23 PM
Anonymous Craig Beere said...

The code does not work if the dynamic distribution group is filtering on something that the -Filter parameter can't search on.

For example,
new-DynamicDistributionGroup -Name "NZ Staff" -RecipientFilter { C -eq "NZ" }

The -Filter parameter can't search on the C attribute, so the following code returns an error.
$NZ = get-DynamicDistributionGroup -Identity "NZ Staff"
get-Recipient -Filter $NZ.RecipientFilter

Cheers
Craig Beere

 
September 4, 2007 10:22 AM
Anonymous Anonymous said...

Same problem for me.

I can create a working DynamicDistributionGroup that includes a RecipientFilter with a RecipientType (Description -like '*Volunteer*'), but I get the following error

Get-Recipient : Cannot bind parameter 'Filter' to the target. Exception setting "Filter": ""Description" is not a recognized filterable property.

Thanks the same though,

Bob

 
September 4, 2007 10:24 AM
Anonymous Anonymous said...

BTW: I guess the only way to test this is to use Message Tracking found in the toolbox.

p.s. Didn't have this problem with Exchange 2003!

Bob

 
September 4, 2007 12:56 PM
Blogger Bharat Suneja said...

Craig,

My Recipientfilter is RecipientType -eq 'UserMailbox' -and CountryOrRegion -eq 'UnitedStates'

Using the above, I can view group membership when I use:
$group = Get-DynamicDistributionGroup US-Users
Get-Recipient -Filter $group.RecipientFilter

 
September 4, 2007 12:58 PM
Blogger Bharat Suneja said...

Bob,

You're right - Description is not a filterable property for RecipientFilter. Check the List of filterable properties doc for a list of which properties can be used in RecipientFilter.

 
June 17, 2008 8:58 AM
Blogger John Twilley said...

I wanted to use this for our e-mail address Policies based on OU.

My queries kept returning TOO MANY results. I realized that I needed the -OrganizationalUnit parameter.


Example:
$Group = Get-DynamicDistributionGroup -Identity "AdminOU"

Get-Recipient -Filter $Group.RecipientFilter -OrganizationalUnit "Catmktg.com/Admin"

 
May 29, 2009 11:17 AM
Anonymous Vince K. said...

filtering on description works fine for me. You may want to be sure to specify the recipienttype as a user because user's definitely have the description property. (RecipientType -eq 'UserMailbox')
Strange thing is if you try to preview the filter from the GUI it does not adhere to the OU you want the filter applied to. For example if you want to apply the filter to a subOU, the preview applies to the entire tree. When you actually send an email to the dynamic distribution group, it does adhere to the group, however. If you know how to easily get an accurate preview list that pays attention to the OU you want it applied to, let me know.

 
February 4, 2010 12:51 PM
Blogger JB said...

Get-Recipient -Filter $Group.RecipientFilter -OrganizationalUnit $_.RecipientContainer

This works well too!

 

Post a Comment

Links to this post:

Create a Link

<< Home