Dymanic Distribution lists
I would like to create a dymanic dis list for all OU's minus just one user. Is there any way I can do this?
Thanks!
Shawn
August 14th, 2008 6:50pm
Are you using Exchange 2007? If yes then you can exclude it while creating it like this
New-DynamicDistributionGroup -Name "DDG Name" -OrganizationalUnit "YourDomain.com/Users" -RecipientContainer "YourDomain.com/YourOUToCreateDDL" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'ExcludeingUserName'))}
Reference: How to Create a New Dynamic Distribution Group
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2008 7:02pm
Thanks, this will help! It is Exchnage 2007 Sp1.
One last question. I need it to apply to the entire domain (contoso.com for example) and not just one OU. Does that change the command line?
Shawn
August 14th, 2008 7:12pm
(I corrected a RecipientContainer switch in my earlier post)
In thecommand you can just give domain name in -RecipientContainer "YourDomain.com" instead of your OU, which will create a DDL for entire domain.
Reference: New-DynamicDistributionGroup
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2008 7:26pm
I am new to this powershell thing, can you tell? I get this error when I try to use the command line. I have replaced the domains with domain.com and users mailbox name with johnsmith.
New-DynamicDistributionGroup : A parameter cannot be found that matches parameter name 'RecipientFilter'.At line:1 char:29+ New-DynamicDistributionGroup <<<< -Name "testtest" -OrganizationalUnit "domain.com/users" -RecipientContainer "domain.com/users" RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'johnsmith'))}
August 14th, 2008 8:47pm
Sorry, RecipientFilter should have leading "-" sign, I just corrected it...
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2008 8:52pm
I ran this command and it works at adding the group to Exchange but it doesn't add anyting to AD? This keeps people from being able to send any email to it. Any ideas?
The problem seems to be if you direct the group to just the domain level and not to a specific OU, it can't find any mailboxes to send it to and bounces it.
Shawn
August 14th, 2008 10:19pm
Hi Shawn:
If the script is adding groups to Exchange, it is adding them to AD. Exchange uses the Active Directory as its Directory Service. When you say they are not in AD, do you mean you can't find them in the domain? Or does it mean that the user can't see them in the GAL?
Jim
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2008 10:38pm
It creates the group fine in Exchange and creates the user for the group in AD as it should. Keep in mind that it is being created to point to the domian only and not to a specific OU. What I am finding out if if you send an email to it, it bounces stating it can't find any receipients..
Since I have no users in the root of AD, I am guessing it can't find anyone to send the message to.
Shawn
August 14th, 2008 10:43pm
I just created a DDL in my test environment and given me list of membersas expected.You may also try by verifying members.
New-DynamicDistributionGroup -Name "All Mailbox Users" -OrganizationalUnit "Domain.com/Users" -RecipientContainer "Domain.com" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'ExcludeingUserName'))}
View the members by this...
$alluser = Get-DynamicDistributionGroup -Identity "All Mailbox Users"Get-Recipient -RecipientPreviewFilter $alluser.RecipientFilter
Reference: How to View Members of a Dynamic Distribution Group
Or you can Review the members by going into properties of DDL in EMC -> Filter tab -> Review button.
Free Windows Admin Tool Kit Click here and download it now
August 15th, 2008 5:43am