Exchange Management Shell confusion with a Dynamic Distribution Group
New to using this but trying to create a DDG that is placed in a certain OU and only picks up e-mail accounts in another OU. Problem I appear to be having is I think it's creating it, but instead of taking e-mails from the specific OU, it's taking all mail enabled users and DDGs. But I don't want it to include the other DDGs. New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" From what I understand this is doing is creating a new DDG called AllWorkStaff in mydomain.org/Liverpool/Distrubtion and Security Groups and only picking up e-mail addresses in micro-soft.org/Liverpool/Directorates. But instead it's picking up all e-mail addresses in micro-soft.org/Liverpool/ as well meaning it's going into Distrubtion and Security Groups and picking up all the DDGs in it, which I don't want it to do. Clearly I'm doing something wrong. Any ideas?
May 29th, 2011 1:28am

I assueme your AD is healthy. Did you try to create the ddg in Directorates OU. In that case you do not need to specify the -Recipientcontainer oprion and see if it works (just as test). You need to make sure the canonical name of all OUs are correct. The root of the canonical name seems different (mydomain.org and micro-soft.org), make sure you use the correct domain when type the command.Vincenzo MCTS, MCTIP Server 2008 | MCTS Exchange 2010 | WatchGuard Firewall Security Professional
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 1:22pm

On Sun, 29 May 2011 05:20:29 +0000, stevenwhiting wrote: > > >New to using this but trying to create a DDG that is placed in a certain OU and only picks up e-mail accounts in another OU. Problem I appear to be having is I think it's creating it, but instead of taking e-mails from the specific OU, it's taking all mail enabled users and DDGs. But I don't want it to include the other DDGs. > >New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" > > > >From what I understand this is doing is creating a new DDG called AllWorkStaff in mydomain.org/Liverpool/Distrubtion and Security Groups and only picking up e-mail addresses in micro-soft.org/Liverpool/Directorates. But instead it's picking up all e-mail addresses in micro-soft.org/Liverpool/ as well meaning it's going into Distrubtion and Security Groups and picking up all the DDGs in it, which I don't want it to do. > >Clearly I'm doing something wrong. Any ideas? Modify your recipientfilter to include "RecipientType -eq 'usermailbox'" (or whatever other types you want). --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
May 29th, 2011 1:34pm

I assueme your AD is healthy. Did you try to create the ddg in Directorates OU. In that case you do not need to specify the -Recipientcontainer oprion and see if it works (just as test). You need to make sure the canonical name of all OUs are correct. The root of the canonical name seems different (mydomain.org and micro-soft.org), make sure you use the correct domain when type the command. Vincenzo MCTS, MCTIP Server 2008 | MCTS Exchange 2010 | WatchGuard Firewall Security Professional Yeah that was a typing error on the forum :) should be mydomain.org I've tried creating it in the directorates OU but it does the same, just appears to pick up the whole of AD where anyone has a e-mail address accept people with CustomAtrribute Managers. So that bit appears to be working I just don't want it picking up the other DDG's which it appears to keep doing.
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 1:59pm

On Sun, 29 May 2011 05:20:29 +0000, stevenwhiting wrote: > > >New to using this but trying to create a DDG that is placed in a certain OU and only picks up e-mail accounts in another OU. Problem I appear to be having is I think it's creating it, but instead of taking e-mails from the specific OU, it's taking all mail enabled users and DDGs. But I don't want it to include the other DDGs. > >New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" > > > >From what I understand this is doing is creating a new DDG called AllWorkStaff in mydomain.org/Liverpool/Distrubtion and Security Groups and only picking up e-mail addresses in micro-soft.org/Liverpool/Directorates. But instead it's picking up all e-mail addresses in micro-soft.org/Liverpool/ as well meaning it's going into Distrubtion and Security Groups and picking up all the DDGs in it, which I don't want it to do. > >Clearly I'm doing something wrong. Any ideas? Modify your recipientfilter to include "RecipientType -eq 'usermailbox'" (or whatever other types you want). --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP Thanks but not sure how that would help. The script appears to work bar the fact it picks up all the other DDGs, when I only want it to pick up mailboxes in the Directorates OU and the DDGs aren't in the Directorates OU.
May 29th, 2011 2:01pm

what if your try. New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -IncludedRecipients "MailboxUsers" -Recipientcontainer "mydomain.org/Liverpool/Directorates"Sukh
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 2:19pm

what if your try. New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -IncludedRecipients "MailboxUsers" -Recipientcontainer "mydomain.org/Liverpool/Directorates" Sukh That seems to work in filtering out the DDG's thanks. But where would I put the -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} As I need this filter in.
May 29th, 2011 2:35pm

1. I think the issue that you're facing is that you're using a customattribute with the recipient filter which wont work. See below. 2. What you might be able to do is use another filter from here - http://technet.microsoft.com/en-us/library/bb738157(EXCHG.80).aspx - You can maybe create a group for the managers and use that as a filter, i.e NOT that group. Then use your original synatx but with the group. 3. Or you can move the managers out of that OU to a sub OU. "The RecipientFilter parameter filters the mail-enabled recipients used to build the dynamic distribution group. The RecipientFilter parameter can't be used if any of the following parameters are specified: IncludedRecipients ConditionalCompany ConditionalCustomAttribute N (where N is a value from 1 through 15) ConditionalDepartment ConditionalStateOrProvince Sukh
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 3:11pm

On Sun, 29 May 2011 17:59:28 +0000, stevenwhiting wrote: >On Sun, 29 May 2011 05:20:29 +0000, stevenwhiting wrote: >>>New to using this but trying to create a DDG that is placed in a certain OU and only picks up e-mail accounts in another OU. Problem I appear to be having is I think it's creating it, but instead of taking e-mails from the specific OU, it's taking all mail enabled users and DDGs. But I don't want it to include the other DDGs. >>>New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" >>>From what I understand this is doing is creating a new DDG called AllWorkStaff in mydomain.org/Liverpool/Distrubtion and Security Groups and only picking up e-mail addresses in micro-soft.org/Liverpool/Directorates. But instead it's picking up all e-mail addresses in micro-soft.org/Liverpool/ as well meaning it's going into Distrubtion and >>>>Security Groups and picking up all the DDGs in it, which I don't want it to do. >>>Clearly I'm doing something wrong. Any ideas? >>Modify your recipientfilter to include "RecipientType -eq 'usermailbox'" (or whatever other types you want). >>--- Rich Matheisen MCSE+I, Exchange MVP >Thanks but not sure how that would help. The script appears to work bar the fact it picks up all the other DDGs, when I only want it to pick up mailboxes in the Directorates OU and the DDGs aren't in the Directorates OU. You started out saying "trying to create a DDG that is placed in a certain OU and only picks up e-mail accounts in another OU" and "But I don't want it to include the other DDGs". Your recipient filter isn't specific about what recipient types it finds, only that CustomAttribute1 doesn't contain 'Managers". Adding the additional conditions will avoid including any recipienttypes but the ones you specify. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
May 29th, 2011 5:28pm

On Sun, 29 May 2011 18:17:43 +0000, Sukh828 wrote: > > >what if your try. > >New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -IncludedRecipients "MailboxUsers" -Recipientcontainer "mydomain.org/Liverpool/Directorates" That doesn't include the condion that CustomAttribut1 isn't 'Managers'> --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 5:29pm

On Sun, 29 May 2011 18:17:43 +0000, Sukh828 wrote: > > >what if your try. > >New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -IncludedRecipients "MailboxUsers" -Recipientcontainer "mydomain.org/Liverpool/Directorates" That doesn't include the condion that CustomAttribut1 isn't 'Managers'> --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP it was a test for the syntax, explanation in other post.Sukh
May 29th, 2011 5:33pm

On Sun, 29 May 2011 18:33:18 +0000, stevenwhiting wrote: > > >what if your try. > >New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -IncludedRecipients "MailboxUsers" -Recipientcontainer "mydomain.org/Liverpool/Directorates" >Sukh > >That seems to work in filtering out the DDG's thanks. But where would I put the > >-RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} > >As I need this filter in. -RecipientFilter {CustomAttribute1 -ne "Managers" -and (RecipientType -eq "UserMailbox" -or RecipientType -eq 'MailUser' -or RecipientType -eq "MailContact")} Add, or remove, RecipientType conditions to suit you needs. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 5:33pm

1. I think the issue that you're facing is that you're using a customattribute with the recipient filter which wont work. See below. 2. What you might be able to do is use another filter from here - http://technet.microsoft.com/en-us/library/bb738157(EXCHG.80).aspx - You can maybe create a group for the managers and use that as a filter, i.e NOT that group. Then use your original synatx but with the group. 3. Or you can move the managers out of that OU to a sub OU. "The RecipientFilter parameter filters the mail-enabled recipients used to build the dynamic distribution group. The RecipientFilter parameter can't be used if any of the following parameters are specified: IncludedRecipients ConditionalCompany ConditionalCustomAttribute N (where N is a value from 1 through 15) ConditionalDepartment ConditionalStateOrProvince Sukh Thanks but I can't move them out of the OU, everything in AD has to stay in it's place due to the way our support desk software picks up from AD.
May 29th, 2011 5:37pm

@Rich - -RecipientFilter {CustomAttribute1 -ne "Managers I thought recipient filter wont work if using a customattribute?Sukh
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 5:38pm

I should probably point out I'm new to setting up Exchange. We just had a little issue at work and I was looking into a fix. I'm doing my testing in some VMs and if it works we could possibly use it at work. It's roughly like this on the AD side (just examples) Liverpool/directorates/Legal/Managers We wanted to create a DDG for All staff so we can do a mass e-mail out. But we found it went to the Managers as well. We didn't want this. Simple way would be to move the Managers outside the Directorates OU because that's what the DDG was created on. However, because of the way our support desk software takes details from AD, moving an OU is a bit of a hassle. So I wanted another way round it, so started looking into how DDG's are setup as never done one before (I'm 2nd line support not Infrastructure). So just thumbing my way through it and trying to understand it. So the original script I posted had the DDG's setup in an OU outside of directorates because I thought the script would then ignore all the DDGs because I was telling the DDG I just want groups/users that are in the Directorates OU, but want the DDG to be stored in another area. If that makes sense?
May 29th, 2011 5:51pm

@Rich - -RecipientFilter {CustomAttribute1 -ne "Managers I thought recipient filter wont work if using a customattribute? Sukh Using the -RecipentFilter worked in my original script, I was just having issues with it picking up the other DDGs which I didn't want it to.
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 5:53pm

I dont think it will work. If it does i'd be confused a little and kindly ask how you got it to work, either the technet documentation is wrong or it didnt quite work as you think. read the recipeintfilter - http://technet.microsoft.com/en-us/library/bb125127.aspx Maybe you can try option 2 I mentioned above, there's quite a few filters you can use, even email addresses (not sure how many managers you have got to list, or use the memeberof option.Sukh
May 29th, 2011 6:07pm

On Sun, 29 May 2011 21:36:59 +0000, Sukh828 wrote: > > >@Rich - -RecipientFilter {CustomAttribute1 -ne "Managers > >I thought recipient filter wont work if using a customattribute? I think you're confusing the use of a -ConditionalCustomAttributeX parameter with using a CustomAttributeX property in a -RecipientFilter. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 8:19pm

On Sun, 29 May 2011 21:49:59 +0000, stevenwhiting wrote: > > >I should probably point out I'm new to setting up Exchange. We just had a little issue at work and I was looking into a fix. I'm doing my testing in some VMs and if it works we could possibly use it at work. > >It's roughly like this on the AD side (just examples) > >Liverpool/directorates/Legal/Managers > >We wanted to create a DDG for All staff so we can do a mass e-mail out. But we found it went to the Managers as well. We didn't want this. Simple way would be to move the Managers outside the Directorates OU because that's what the DDG was created on. However, because of the way our support desk software takes details from AD, moving an OU is a bit of a hassle. So I wanted another way round it, so started looking into how DDG's are setup as never done one before (I'm 2nd line support not Infrastructure). So just thumbing my way through it and trying to understand it. > >So the original script I posted had the DDG's setup in an OU outside of directorates because I thought the script would then ignore all the DDGs because I was telling the DDG I just want groups/users that are in the Directorates OU, but want the DDG to be stored in another area. If that makes sense? Forget about where in the AD hierarchy the DDG is located. It has nothing to with what you're trying to accomplish. Your original attempt (below) will include all the mail-enabled objects in the OU that don't have 'Managers' in CustomAttribute1. If there are mail-enabled groups, dynamic grouips, contacts, users, and mailboxes in that OU they're all subjected to that one condition "CustomAttribute1 -ne 'Managers". Original: New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" If you want to include only mailboxes, and only mailboxes of non-managers, then you recpient filter must be more selective than just "CustomAttribute1 -ne 'Managers'". That why I suggested you change it to: -RecipientFilter {CustomAttribute1 -ne "Managers" -and (RecipientType -eq "UserMailbox" -or RecipientType -eq 'MailUser' -or RecipientType -eq "MailContact")} Now it will only select non-managers that aren't groups, dynamic groups, or public folders. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
May 29th, 2011 8:29pm

@Rich - I see what you mean about the filtering properties for custom attributes, there are 2 types. @Steven - You are right, it can work. What Rich is suggesting should work fine. Also, if you want, have a look at the the link I sent which has other properties you can filter on. ((http://technet.microsoft.com/en-us/library/bb738157(EXCHG.80).aspx). however it seems like you already have custom attribute set so just use that.Sukh
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 5:50am

On Sun, 29 May 2011 21:49:59 +0000, stevenwhiting wrote: > > >I should probably point out I'm new to setting up Exchange. We just had a little issue at work and I was looking into a fix. I'm doing my testing in some VMs and if it works we could possibly use it at work. > >It's roughly like this on the AD side (just examples) > >Liverpool/directorates/Legal/Managers > >We wanted to create a DDG for All staff so we can do a mass e-mail out. But we found it went to the Managers as well. We didn't want this. Simple way would be to move the Managers outside the Directorates OU because that's what the DDG was created on. However, because of the way our support desk software takes details from AD, moving an OU is a bit of a hassle. So I wanted another way round it, so started looking into how DDG's are setup as never done one before (I'm 2nd line support not Infrastructure). So just thumbing my way through it and trying to understand it. > >So the original script I posted had the DDG's setup in an OU outside of directorates because I thought the script would then ignore all the DDGs because I was telling the DDG I just want groups/users that are in the Directorates OU, but want the DDG to be stored in another area. If that makes sense? Forget about where in the AD hierarchy the DDG is located. It has nothing to with what you're trying to accomplish. Your original attempt (below) will include all the mail-enabled objects in the OU that don't have 'Managers' in CustomAttribute1. If there are mail-enabled groups, dynamic grouips, contacts, users, and mailboxes in that OU they're all subjected to that one condition "CustomAttribute1 -ne 'Managers". Original: New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" If you want to include only mailboxes, and only mailboxes of non-managers, then you recpient filter must be more selective than just "CustomAttribute1 -ne 'Managers'". That why I suggested you change it to: -RecipientFilter {CustomAttribute1 -ne "Managers" -and (RecipientType -eq "UserMailbox" -or RecipientType -eq 'MailUser' -or RecipientType -eq "MailContact")} Now it will only select non-managers that aren't groups, dynamic groups, or public folders. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP Thanks for everyone's help. This worked. What I don't get is you said my original one would do what I wanted but would also pick up groups, DDGs etc in that OU. However, that was why I was trying to create the DDG in a different OU, so that it wouldn't get picked up. So even though it was in a different OU to the one I specified in the script and that there were no groups or DDGs in that OU, they were still being picked up. Which suggested to me, it was totally ignoring the OU I was telling it to filter in and was instead scanning the whole of AD. Thanks Sukh, the MS link looks useful but I never find their stuff easy to understand in the way they explain it which is another reason I was getting confused.
May 30th, 2011 6:19pm

On Mon, 30 May 2011 22:18:46 +0000, stevenwhiting wrote: >On Sun, 29 May 2011 21:49:59 +0000, stevenwhiting wrote: > > >I should probably point out I'm new to setting up Exchange. We just had a little issue at work and I was looking into a fix. I'm doing my testing in some VMs and if it works we could possibly use it at work. > >It's roughly like this on the AD side (just examples) > >Liverpool/directorates/Legal/Managers > >We wanted to create a DDG for All staff so we can do a mass e-mail out. But we found it went to the Managers as well. We didn't want this. Simple way would be to move the Managers outside the Directorates OU because that's what the DDG was created on. However, because of the way our support desk software takes details from AD, moving an OU is a bit of a hassle. So I wanted another way round it, so started looking into how DDG's are setup as never done one before (I'm 2nd line support not Infrastructure). So just thumbing my way through it and trying to understand it. > >So the original script I posted had the DDG's >setup in an OU outside of directorates because I thought the script would then ignore all the DDGs because I was telling the DDG I just want groups/users that are in the Directorates OU, but want the DDG to be stored in another area. If that makes sense? Forget about where in the AD hierarchy the DDG is located. It has nothing to with what you're trying to accomplish. Your original attempt (below) will include all the mail-enabled objects in the OU that don't have 'Managers' in CustomAttribute1. If there are mail-enabled groups, dynamic grouips, contacts, users, and mailboxes in that OU they're all subjected to that one condition "CustomAttribute1 -ne 'Managers". Original: New-DynamicDistributionGroup -Name "AllWorkStaff" -OrganizationalUnit "mydomain.org/Liverpool/Distrubtion and Security Groups" -RecipientFilter {( -not(CustomAttribute1 -eq "Managers"))} -Recipientcontainer "micro-soft.org/Liverpool/Directorates" If you want to include only mailboxes, and only mailboxes of >non-managers, then you recpient filter must be more selective than just "CustomAttribute1 -ne 'Managers'". That why I suggested you change it to: -RecipientFilter {CustomAttribute1 -ne "Managers" -and (RecipientType -eq "UserMailbox" -or RecipientType -eq 'MailUser' -or RecipientType -eq "MailContact")} Now it will only select non-managers that aren't groups, dynamic groups, or public folders. --- Rich Matheisen MCSE+I, Exchange MVP >--- Rich Matheisen MCSE+I, Exchange MVP > >Thanks for everyone's help. This worked. > > > >What I don't get is you said my original one would do what I wanted but would also pick up groups, DDGs etc in that OU. It would . . . in the "micro-soft.org/Liverpool/Directorates" Organizational Unit. That's where you set the base of the search scope. >However, that was why I was trying to create the DDG in a different OU, so that it wouldn't get picked up. You were telling it to search in the hierarchy starting at the "micro-soft.org/Liverpool/Directorates" OU. Placing it in the same, or different, OU would only make a difference for the DDG named "AllWorkStaff". All other AD objects in the "micro-soft.org/Liverpool/Directorates" OU would have been subjected to your reciient filter. >So even though it was in a different OU to the one I specified in the script and that there were no groups or DDGs in that OU, they were still being picked up. That type of behavior is usually caused by an incorrect "-RecipientContainer" specification. >Which suggested to me, it was totally ignoring the OU I was telling it to filter in and was instead scanning the whole of AD. That would only be true if you nominated the domain itself as the base of the search. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2011 10:16pm

I see what you mean now. However, the reason I'm confused is because there were no other, on the VM setup I was testing this on, DDGs, DGs Groups or Public Folders in that Directorates OU. So I'm confused at how it was picking those the other DDGs up that were never in the Directorates OU which is where my script was searching. If that makes sense.
May 31st, 2011 9:05am

Sorry have had to unmark as answer. Have now found that although it is filtering out Managers it still, for some weird reason is searching in other OU's that are above Directorates.
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 9:47am

Doing a Google search for answer I came across this :) http://www.tech-archive.net/Archive/Exchange/microsoft.public.exchange.admin/2009-04/msg00148.html Asking similar question in that want to filter by OU yet it's searching/filtering the whole of AD instead and appears you Rich, were trying to help there as well :) But alas, there was no answer.
May 31st, 2011 10:04am

It's driving me nuts. There are no good guides on the subject, not easy to understand guides. But finally found out that if you use -RecipientFilter and customattribute the -RecipientContainer" gets ignored. This is why it is checking for accounts outside of the Directorates OU. But I can't find any decent guides that suggest a work around for our specific issue.
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 4:41pm

On Tue, 31 May 2011 13:46:03 +0000, stevenwhiting wrote: >Sorry have had to unmark as answer. Have now found that although it is filtering out Managers it still, for some weird reason is searching in other OU's that are above Directorates. I'm not sure what you're doing, but what you say is happening shouldn't be happening. I just created two DDLS: New-DynamicDistributionGroup ddl0 -recipientfilter {Manager -like "*Matheisen*"} -OrganizationalUnit domain.com/OURHOUSE -recipientcontainer domain.com/TEST New-DynamicDistributionGroup ddl1 -recipientfilter {Manager -like "*Matheisen*"} -OrganizationalUnit domain.com/OURHOUSE -recipientcontainer domain.com/OURHOUSE With the exception of the "-recipientcontainer" they're both identical. There's only one user in the AD that has me as its manager and it's in the TEST OU. The "ddl0" finds that user. The "ddl1" does not. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
May 31st, 2011 10:59pm

I'll give it another try. But with all the searching I've done I've found various posts of people asking essentially the same thing, with you helping out :) but it came to other people saying that the RecipientContainer is ignored if the -recipientfilter is used.
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 7:45am

On Tue, 31 May 2011 13:46:03 +0000, stevenwhiting wrote: >Sorry have had to unmark as answer. Have now found that although it is filtering out Managers it still, for some weird reason is searching in other OU's that are above Directorates. I'm not sure what you're doing, but what you say is happening shouldn't be happening. I just created two DDLS: New-DynamicDistributionGroup ddl0 -recipientfilter {Manager -like "*Matheisen*"} -OrganizationalUnit domain.com/OURHOUSE -recipientcontainer domain.com/TEST New-DynamicDistributionGroup ddl1 -recipientfilter {Manager -like "*Matheisen*"} -OrganizationalUnit domain.com/OURHOUSE -recipientcontainer domain.com/OURHOUSE With the exception of the "-recipientcontainer" they're both identical. There's only one user in the AD that has me as its manager and it's in the TEST OU. The "ddl0" finds that user. The "ddl1" does not. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP I believe it's because you aren't using CustomAttribute1 which is what I'm using. Because in my real world setup, in this field I have to put Councillors. So when we do the filter we have to do a filter on CustomAttribute1 and according to what I've read into, if you are doing a filter on a CustomAttribute then Recipientcontainer is ignored.
June 1st, 2011 10:57am

1. As a test, what if you try option 2 I posted.Sukh
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 11:07am

On Wed, 1 Jun 2011 14:55:54 +0000, stevenwhiting wrote: >On Tue, 31 May 2011 13:46:03 +0000, stevenwhiting wrote: >I believe it's because you aren't using CustomAttribute1 which is what I'm using. I don't believe that's the case at all. >Because in my real world setup, In the "real world" I use DDLs a lot. They work (if you build them right). >in this field I have to put Councillors. I thought it was "Managers". :-) >So when we do the filter we have to do a filter on CustomAttribute1 and according to what I've read into, if you are doing a filter on a CustomAttribute then Recipientcontainer is ignored. I'm guessing what you read is only the complaints of people that say it doesn't work, right? Very few people post "Look at this! It works just the way it says it should!" See this: http://technet.microsoft.com/en-us/library/bb232019(EXCHG.80).aspx And the note in the section "To use the Exchange Management Console to preview the list of members for a dynamic distribution group that uses a custom filter": .. Note: .. Custom filters may not filter the members of the group correctly .. when you use the Exchange Management Console to preview the list of .. members for a dynamic distribution group. If you experience this .. issue, use the Exchange Management Shell to obtain an accurate list .. of members for a dynamic distribution group. A little further down, see "To use the Exchange Management Shell to preview the list of members for a dynamic distribution group". Try that with your DDL and see if you get the expected results. If you don't believe what you see there, build a DDL that has only one of two objects that match your criteria and then send an e-mail to the DDL. See who gets the e-mail. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
June 1st, 2011 10:03pm

I'll give it a go thanks. But the info I found was various threads from all over the place, that oddly enough you'd commented in :) and one such thread is in this Technet section. http://social.technet.microsoft.com/Forums/en-GB/exchangesvradmin/thread/46a5bba2-fa67-4821-ab85-08a77fa843c9
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2011 3:38am

Sorry to be a pain in the arse :) but what command would I use in the shell to get the DDL list? I run this now to create the DDG but having issues with the command to view the members of the group (even after reading the link you provided. This powershell scripting isn't exactly easy :( ) New-DynamicDistributionGroup -Name "TestAll" -OrganizationalUnit "micro-soft.org/Worthing/WBC Distribution Groups" -RecipientFilter {CustomAttribute1 -ne "Councillors" -and (RecipientType -eq "UserMailbox" -or RecipientType -eq 'MailUser' -or RecipientType -eq "MailContact")} -Recipientcontainer "micro-soft.org/Worthing/Directorates"
June 2nd, 2011 9:38am

On Thu, 2 Jun 2011 13:29:54 +0000, stevenwhiting wrote: >Sorry to be a pain in the arse :) but what command would I use in the shell to get the DDL list? $M = Get-DynamicDistributionGroup testall Get-Recipient -RecipientPreviewFilter $M.RecipientFilter -OrganizationalUnit $M.RecipientContainer --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2011 10:37pm

On Thu, 2 Jun 2011 07:36:31 +0000, stevenwhiting wrote: >I'll give it a go thanks. But the info I found was various threads from all over the place, that oddly enough you'd commented in :) and one such thread is in this Technet section. > >http://social.technet.microsoft.com/Forums/en-GB/exchangesvradmin/thread/46a5bba2-fa67-4821-ab85-08a77fa843c9 What I said there was true, I obviously missed the part where he said he already had the -recipientcontainer specified. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
June 2nd, 2011 10:41pm

After a test on the live I'll be marking your post as the answer I believe :) a test on the VM suggests you're right and that it is a bug in the preview button. Have they never fixed that?
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2011 5:00am

On Thu, 2 Jun 2011 13:29:54 +0000, stevenwhiting wrote: >Sorry to be a pain in the arse :) but what command would I use in the shell to get the DDL list? $M = Get-DynamicDistributionGroup testall Get-Recipient -RecipientPreviewFilter $M.RecipientFilter -OrganizationalUnit $M.RecipientContainer --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP Doesn't appear to be displaying the OU in the Output and there are far less people appearing in the output than should be appearing.
June 3rd, 2011 8:09am

On Fri, 3 Jun 2011 12:07:38 +0000, stevenwhiting wrote: >On Thu, 2 Jun 2011 13:29:54 +0000, stevenwhiting wrote: >Sorry to be a pain in the arse :) but what command would I use in the shell to get the DDL list? $M = Get-DynamicDistributionGroup testall Get-Recipient -RecipientPreviewFilter $M.RecipientFilter -OrganizationalUnit $M.RecipientContainer --- Rich Matheisen MCSE+I, Exchange MVP >--- Rich Matheisen MCSE+I, Exchange MVP >Doesn't appear to be displaying the OU in the Output and there are far less people appearing in the output than should be appearing. Add " | ft name,organiz*" at the end of the "get-recipient" command. If there are fewer results than you thing there should be then you'll have to reexamine your criteria. Either your recipient filter is incorrect, your recipient conainer is wrong, or the number of objects that match the recipient filter within the scope of the recipient container is different to your expectations. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2011 3:53am

Still working on this but thanks for all the help. One other question. To create the DDG I used the CustomAttribute1 and that it has to contain the word Councillors. If a new Councillor starts and they are put in the correct OU but the CustomAttribute1 on their mailbox isn't set to Councillors, I assume this means they won't automatically be picked up by the DDG? And how often does the DDG update itself?
June 14th, 2011 10:33am

On Tue, 14 Jun 2011 12:58:31 +0000, stevenwhiting wrote: > > >Still working on this but thanks for all the help. > >One other question. To create the DDG I used the CustomAttribute1 and that it has to contain the word Councillors. If a new Councillor starts and they are put in the correct OU but the CustomAttribute1 on their mailbox isn't set to Councillors, I assume this means they won't automatically be picked up by the DDG? That's correct. The criteria for selecting mailboxes hasn't been met. >And how often does the DDG update itself? Update? The DDG doen't contain members if that's what you're thinking. It just has a set of criteria to use in locating objects to include in the current message. You send a message to the DDG and the DDG says "Hey, Active Director! Find everything you can that looks like this." --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 9:58pm

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

Other recent topics Other recent topics