locked
Exchange 2007 - Dynamic Distribution group issue. RRS feed

  • Question

  • Hi,

     

    I am having some trouble with a Dynanic Distribution group that I am creating, it is not working the way I understand that it should.

    the command I have typed into the shell is as below:

    New-DynamicDistributionGroup '# Test' -OrganizationalUnit "mydomain.CO.UK/All Non-Comapny Contacts" -RecipientFilter {(RecipientType -eq 'MailContact') -and -not (Company -like 'Company1' -or Company -like 'Company2' -or Company -like 'Company3' -or Company -like 'Comapny4' -or Company -like 'Company5')} -RecipientContainer "mydomain.CO.UK/All Non-Company Contacts"

     

    Now the way I understand this, this will give me a group that included everything in and under the All Non-Company Contacts OU where the comany name is not Company 1..2 etc.

    However this is not how it is working? It is excluding the contacts that I am expecting it to exclude, however it is also including Contacts that are not in or under the OU All Non-Company Contacts, it is including all contacts in the domain that do not have a company name of the above.

    Now as I understand it, it should only be including contacts that are contained in and under the OU I have specified right??

    Wednesday, March 2, 2011 2:29 PM

All replies

  • Now as I understand it, it should only be including contacts that are contained in and under the OU I have specified right??


    Yes it is and actually you even don't have to define it in -RecipientContainer since it is the same location as in -OrganizationalUnit that dictates where to create the distribution group.

    "The RecipientContainer parameter filters the recipients that are used to build the dynamic distribution group based on their location in Active Directory. The value of RecipientContainer can be the canonical name of an organizational unit (OU) or a domain. If you do not specify a value for RecipientContainer, the default search filter is the location of the dynamic distribution group in Active Directory. This location is specified by using the OrganizationalUnit parameter."


    Jesper Bernle | Blog: http://xchangeserver.wordpress.com
    Wednesday, March 2, 2011 2:43 PM
  • Now as I understand it, it should only be including contacts that are contained in and under the OU I have specified right??


    Yes it is and actually you even don't have to define it in -RecipientContainer since it is the same location as in -OrganizationalUnit that dictates where to create the distribution group.

    "The RecipientContainer parameter filters the recipients that are used to build the dynamic distribution group based on their location in Active Directory. The value of RecipientContainer can be the canonical name of an organizational unit (OU) or a domain. If you do not specify a value for RecipientContainer, the default search filter is the location of the dynamic distribution group in Active Directory. This location is specified by using the OrganizationalUnit parameter."


    Jesper Bernle | Blog: http://xchangeserver.wordpress.com
    so do you have any idea why this is trying to include everyone from the entire Directory?
    Wednesday, March 2, 2011 4:00 PM
  • Try the same command removing the -recipientcontainer attribute as it takes from the parent OU of the DL itself.
    Thursday, March 3, 2011 8:52 AM
  • Try the same command removing the -recipientcontainer attribute as it takes from the parent OU of the DL itself.

    Hi,

    Thanks for the reply, unfortunately this has not resolved the problem either. It is still including everybody

    Thursday, March 3, 2011 9:08 AM
  • does anyone else have any ideas on this issue??

     

    I am pulling my hair out with this one, Microsoft's documentation is about as much use as a chocolate fire guards!

    Friday, March 4, 2011 8:55 AM
  • New-DynamicDistributionGroup -Name "# Test" -OrganizationalUnit "mydomain.CO.UK/OUforDistributionGroups" -RecipientContainer "mydomain.CO.UK/All Non-Company Contacts" -RecipientFilter {((RecipientType -eq 'MailContact') -and (-not (Company -like 'Company1')) -and (-not (Company -like 'Company2')) -and (-not (Company -like 'Company3')) -and (-not (Company -like 'Comapny4')) -and (-not (Company -like 'Company5')))}

    Try it to see if this formula works better ..


    Jesper Bernle | Blog: http://xchangeserver.wordpress.com
    Friday, March 4, 2011 11:37 AM
  • Hi jcnewman83,

    Any updates?


    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.
    Monday, March 7, 2011 3:20 AM
  • Hi jcnewman83,

    Any updates?


    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.

    Hi,

     

    yes, I have tried the command suggested by Jesper Bernie and this is not working correctly either??

    I am still getting contact entries included from the entire domain??

     

    Monday, March 7, 2011 12:00 PM
  • New-DynamicDistributionGroup -Name "# Test" -OrganizationalUnit "mydomain.CO.UK/OUforDistributionGroups" -RecipientContainer "mydomain.CO.UK/All Non-Company Contacts" -RecipientFilter {((RecipientType -eq 'MailContact') -and (-not (Company -like 'Company1')) -and (-not (Company -like 'Company2')) -and (-not (Company -like 'Company3')) -and (-not (Company -like 'Comapny4')) -and (-not (Company -like 'Company5')))}

    Try it to see if this formula works better ..


    Jesper Bernle | Blog: http://xchangeserver.wordpress.com

    Hi Jesper,

     

    Unfortunately this is not working either??

    Wednesday, March 9, 2011 10:16 AM
  • Could you try creating a simple DDG to see if it also "ignores" the -recipientContainer as well. I find it wierd that the command above works perfectly for me but not for you. It feels like this should be an All or Nothing situation, right? Give it a try and post back.
    Jesper Bernle | Blog: http://xchangeserver.wordpress.com
    Wednesday, March 9, 2011 7:23 PM
  • Could you try creating a simple DDG to see if it also "ignores" the -recipientContainer as well. I find it wierd that the command above works perfectly for me but not for you. It feels like this should be an All or Nothing situation, right? Give it a try and post back.
    Jesper Bernle | Blog: http://xchangeserver.wordpress.com

    Hi,

    Sorry for the slow reply, I have been off ill for a while and just back in the office.

    I have tried adding just a plain vanilla dynamic distribution group in the desired OU and it works as expected??

     

    Tuesday, March 22, 2011 9:50 AM
  • Okay. Interesting. Can you break your working DDG by chaning the Recipient Filter to -RecipientFilter {((RecipientType -eq 'MailContact') -and (-not (Company -like 'Company1')) -and (-not (Company -like 'Company2')) -and (-not (Company -like 'Company3')) -and (-not (Company -like 'Comapny4')) -and (-not (Company -like 'Company5')))}
    Jesper Bernle | Blog: http://xchangeserver.wordpress.com
    Tuesday, March 22, 2011 1:15 PM