Set-DynamicDistributionGroup Problems in Exchange 2010
I have a script that I would run in Exchange 2007 to create dynamic distribution groups based off of security group membership. The command works fine in Exchange 2007, but not in Exchange 2010. Here's the command I would run in Exchange 2007: ---------------------------------------------------------------------------------------------------------$DynDistGroup="Dynamic Distribution Group 1" $SecurityGroupDN="cn=Admin_Security_Group1,ou=groups,dc=contoso,dc=dom" Set-DynamicDistributionGroup -Identity $DynDistGroup -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (MemberOfGroup -eq $SecurityGroupDN))} -RecipientContainer "ou=users,dc=contoso,dc=dom" --------------------------------------------------------------------------------------------------------- The only way I can get the command to work in Exchange 2010 is if I do NOT use a variable in the -RecipientFilter section. For example, the following works in Exchange 2010: ---------------------------------------------------------------------------------------------------------$DynDistGroup="Dynamic Distribution Group 1" $SecurityGroupDN="cn=Admin_Security_Group1,ou=groups,dc=contoso,dc=dom" Set-DynamicDistributionGroup -Identity $DynDistGroup -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (MemberOfGroup -eq "cn=Admin_Security_Group1,ou=groups,dc=contoso,dc=dom"))} -RecipientContainer "ou=users,dc=contoso,dc=dom" --------------------------------------------------------------------------------------------------------- Does anyone know a way I can get variables to work in the -RecipientFilter section in Exchange 2010? I need to use variables because I loop through an input list of many groups. Thanks in advance.
December 2nd, 2010 2:51pm

Hi, What's error your got when trying to run the following script? ------------- $DynDistGroup="Dynamic Distribution Group 1" $SecurityGroupDN="cn=Admin_Security_Group1,ou=groups,dc=contoso,dc=dom" Set-DynamicDistributionGroup -Identity $DynDistGroup -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (MemberOfGroup -eq $SecurityGroupDN))} -RecipientContainer "ou=users,dc=contoso,dc=dom" ------------ I cannot reproduce this problem in exchangge 2010 SP1.Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
Free Windows Admin Tool Kit Click here and download it now
December 3rd, 2010 5:13am

Hi, What's error your got when trying to run the following script? ------------- $DynDistGroup="Dynamic Distribution Group 1" $SecurityGroupDN="cn=Admin_Security_Group1,ou=groups,dc=contoso,dc=dom" Set-DynamicDistributionGroup -Identity $DynDistGroup -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (MemberOfGroup -eq $SecurityGroupDN))} -RecipientContainer "ou=users,dc=contoso,dc=dom" ------------ I cannot reproduce this problem in exchangge 2010 SP1. Gen Lin TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
December 3rd, 2010 1:12pm

Hi, How thing is going go? Could you post the error here for further search?Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
Free Windows Admin Tool Kit Click here and download it now
December 5th, 2010 8:41pm

There is no error. The problem is the cmdlet in Exchange 2010 does not seem to honor the variable. It just sets the dynamic group up with the "MemberOfGroup" part of the filter missing.
December 6th, 2010 8:59am

Hi, Thank you for your reply. I also reproduced this problem in my lab. I think this is a bug in exchange shell. I have forwarded this problem to Exchange Produced Team. Thanks again for your feedback. Gen Lin TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
Free Windows Admin Tool Kit Click here and download it now
December 9th, 2010 5:28am

Gen Lin, Already got an update on this case, I am experiencing the same issue with Exchange 2010 SP1 with Rollup 3v3. Regards, JohanExchange-blog: www.johanveldhuis.nl
July 11th, 2011 8:32am

Tested and found the following working for Exchange 2010 (tested with SP1 ru3v3): Test CSV file (don't forget those "" around the DN !): Name,Distinguishedname TestGruppe1,"CN=Administrators,CN=Builtin,DC=europe,DC=nl,DC=intra" Script: $csv = import-csv file.csv foreach($data in $csv) { new-DynamicDistributionGroup $data.name -RecipientFilter "MemberOfGroup -eq '$($data.distinguishedname)'" } Is this something the original poster was looking for? Of course, you could also use a CSV with only a Dynamig DG name and a group name (instead of a DN). After all, the DN is something you can lookup using the group and getting its distringuishedName attribute. Regards, Michel de Rooij, MCITP Ent.Msg 2007+2010| MCTS W2008, Ex2007+2010 Conf, OCS2007 Conf | MCSE+Msg2k3 | MCSE+Inet2k3 | Prince2 Fnd | ITIL I blog on http://eightwone.wordpress.com/ and tweet on http://twitter.com/mderooij
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 9:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics