Link to home
Start Free TrialLog in
Avatar of Terry Rogers
Terry RogersFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Creating a Dynamic Distribution Group by AD Group Membership in Exchange 2010

I am trying to create a dynamic distribution list that uses a recipient filter based up membership of a specific group.

I am issuing the following command at a Exchange Powershell prompt:

new-DynamicDistributionGroup -Name 'Test SDL' -OrganizationalUnit 'mydomain.com/Level 1a/Sub Level 2' -Alias 'Test SDL' -RecipientFilter {(MemberOfGroup -eq "CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com")}

Open in new window


The SDL is created without error, and is created in the correct OU within Active Directory. I have to amend the recipient container to point to the correct place to apply the filter (Is there a way to do this as part of the initial powershell command?)

The generated recipients filter looks like:

((MemberOfGroup -eq 'CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com') -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))

Open in new window


The Preview button doesn't return any results, and when emailing the SDL there is no error message returned, but the users within the group do not receive any mail.

Any help gratefully received!
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

hello,

a bit of troubleshooting here

change the MemberOfGroup -like 'CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com'


start by taking off all the others

just do the memberof

(MemberOfGroup -eq 'CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com')

and see whether it works
Avatar of Terry Rogers

ASKER

I amended the recipient filter, but this didn't resolve the issue.

When amending MemberofGroup to MemberOf I get the error "Exception setting "RecipientFilter": ""MemberOf" is not a recognized filterable property."

Additionally I don't know how to stop the auto generated recipient filter from adding all the other bits (-and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
new-DynamicDistributionGroup -Name 'Test SDL 2' -OrganizationalUnit 'mydomain.com/Level 1a/Sub Level 2' -Alias 'Test SDL' -RecipientFilter {(MemberOfGroup -LIKE "CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com")}


try the above (change from equal to like
I tried the LIKE version, but this too doesn't work.
new-DynamicDistributionGroup -Name 'Test SDL 3' -Alias 'Test SDL' -RecipientFilter {(MemberOfGroup -eq "CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com")}

Try this? (I wonder OU and Recipient filter could conflict)

also, do you have result on
Get-Recipient -Filter {(MemberOfGroup -eq "CN=My Group,OU=Level 3,OU=Level 2,OU=Level 1,DC=mydomain,DC=com")}?
Nether the shorted distribution group, nor the Get-Recipient -Filter yielded any results.

Are there any logs I can look at?

I do have full access to our Exchange environment.
is the group really have users?

we might need to change the way to build this dynamic distribution group

why build against another group? can you use attribute?
The group will be managed by several different people so unfortunately is does need to be utilizing the memberofgroup.

Yes, it has one user, myself.
Interestingly I can't seem to get any Custom Filters to work... :/
do you have multiple exchange server / Domain controller?
Yep, we have a dozen controllers across a forest containing 3 domains. We then have 6 exchange servers.
Okay. what kind of group is that?
i did some testing that global/universal group is fine but domain local group will not work.
Hello, im currently out of the office on annual leave for 2 weeks so wont be able to check these details until my return.
Hello, I am back off leave and now catching up. I'll check the group type as soon as I can and update this question shortly.
Hi Jian An Lim,

Apologies for the slow replies.

The Group scope is Global and the Group type is Security.
ASKER CERTIFIED SOLUTION
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Universal seems to work! Which when you think about it makes more sense, especially in our multi-tiered domain.

I'm in the process of trying a few more tests, but it is looking positive.
Cool. Let me know if you still need any help :)
Universal it is, such a simple thing, but I couldn't find anything that pointed to a specific scope requirement.

Thank you Jian An Lim, that was really beginning to bug me! :)