locked
Dynamic Distribution Group and filter RRS feed

  • Question

  • I have a DDG that has an OPATH filter and the recipient filter on the DDG is an OU in AD with all the user accounts in it. However when I export the users of this DDG there are much more email enabled accounts than we have employees. Also, when I use Outlook to email the DDG it says "This message will be sent to 250 recipients" while we do not have that many employees.

    Example:

    [PS] C:\Users\hrice\Desktop>$group=Get-DynamicDistributionGroup -identity 'all users'
    [PS] C:\Users\hrice\Desktop>Get-Recipient -RecipientPreviewFilter $group.recipientfilter | export-csv c:\allusers.txt

    That command exports about 350 accounts

    If I preview the DDG it has the same number that Outlook says it will send to. Why does the preview and the export show different totals. I want the DDG to grab only employee enabled email accounts only.

    How can I export whats int eh Preview box and only what are employees with email addresses?


    Monday, October 15, 2012 7:16 PM

Answers

  • On Mon, 15 Oct 2012 19:16:41 +0000, badlands2011 wrote:
     
    >
    >
    >I have a DDG that has an OPATH filter and the recipient filter on the DDG is an OU in AD with all the user accounts in it. However when I export the users of this DDG there are much more email enabled accounts than we have employees. Also, when I use Outlook to email the DDG it says "This message will be sent to 250 recipients" while we do not have that many employees.
    >
    >Example:
    >
    >[PS] C:\Users\hrice\Desktop>$group=Get-DynamicDistributionGroup -identity 'all users' [PS] C:\Users\hrice\Desktop>Get-Recipient -RecipientPreviewFilter $group.recipientfilter | export-csv c:\allusers.txt
    >
    >That command exports about 350 accounts
    >
    >If I preview the DDG it has the same number that Outlook says it will send to. Why does the preview and the export show different totals. I want the DDG to grab only employee enabled email accounts only. How can I export whats int eh Preview box and only what are employees with email addresses?
     
    You haven't restricted your "get-recipient" cmdlet to using the same
    scope as your DDG.
     
    Try this:
     
    Get-Recipient -RecipientPreviewFilter $group.recipientfilter
    -OrganizationalUnit $group.RecipientContainer
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by badlands2011 Tuesday, October 16, 2012 2:47 PM
    Tuesday, October 16, 2012 2:50 AM

All replies

  • It sounds as if your recipient filter isn't right.  But I can't say for sure because you didn't share that very important piece of information with us.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Monday, October 15, 2012 9:39 PM
  • Here you go:

    ((((Department -ne 'Resource') -and (DisplayName -ne 'noreply'))) -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')))

    Monday, October 15, 2012 9:48 PM
  • This should do it.

    ((((RecipientType -eq 'UserMailbox') -and (Department -ne 'Resource') -and (DisplayName -ne 'noreply'))) -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')))

    There are a few simplifications you can make.  Instead of (-not (something -eq something)) you can use (something -ne something).  You may be able to eliminate a number of those exceptions at the end if they aren't filter out UserMailboxes, but there's no harm in leaving them in.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Monday, October 15, 2012 11:10 PM
  • On Mon, 15 Oct 2012 19:16:41 +0000, badlands2011 wrote:
     
    >
    >
    >I have a DDG that has an OPATH filter and the recipient filter on the DDG is an OU in AD with all the user accounts in it. However when I export the users of this DDG there are much more email enabled accounts than we have employees. Also, when I use Outlook to email the DDG it says "This message will be sent to 250 recipients" while we do not have that many employees.
    >
    >Example:
    >
    >[PS] C:\Users\hrice\Desktop>$group=Get-DynamicDistributionGroup -identity 'all users' [PS] C:\Users\hrice\Desktop>Get-Recipient -RecipientPreviewFilter $group.recipientfilter | export-csv c:\allusers.txt
    >
    >That command exports about 350 accounts
    >
    >If I preview the DDG it has the same number that Outlook says it will send to. Why does the preview and the export show different totals. I want the DDG to grab only employee enabled email accounts only. How can I export whats int eh Preview box and only what are employees with email addresses?
     
    You haven't restricted your "get-recipient" cmdlet to using the same
    scope as your DDG.
     
    Try this:
     
    Get-Recipient -RecipientPreviewFilter $group.recipientfilter
    -OrganizationalUnit $group.RecipientContainer
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    • Marked as answer by badlands2011 Tuesday, October 16, 2012 2:47 PM
    Tuesday, October 16, 2012 2:50 AM