Dynamic Distribution Group and filter
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?
October 15th, 2012 3:16pm
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."
Free Windows Admin Tool Kit Click here and download it now
October 15th, 2012 5:39pm
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')))
October 15th, 2012 5:48pm
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."
Free Windows Admin Tool Kit Click here and download it now
October 15th, 2012 7:10pm
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
October 15th, 2012 10:50pm