• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3781
  • Last Modified:

How to create Dynamic Distribution List Applied to an OU

Hi there,
An expert kindly showed me how to create a dynamic distribution list which i have attached below.
However when i created this it was applied to the users ou.
I have no users in the standard ou so it did not work.
I figured out how to apply this to the root domain, however now my list includes all service and non user email addtresses which i dont want, i only want a dynamic distribution list of user email addresses.
I tryed to apply this to the ou we have all users in but it did not seem to recognize the ou.
could someone give me an example im using exchange 2007


New-DynamicDistributionGroup -Name "Some Group Name" -RecipientFilter {(WindowsEmailAddress  -like '*@domain.com')}
0
dougdog
Asked:
dougdog
  • 7
  • 6
1 Solution
 
DocCan11Commented:
new-DynamicDistributionGroup -Name 'test' -IncludedRecipients 'MailboxUsers' -OrganizationalUnit 'Adatum.com/Legal' -Alias 'test' -RecipientContainer 'Adatum.com/Legal'

ok.. you will need to replace the OrganizationalUnit with yours and I made it only for mailbox users. .if you need it different let me know
0
 
dougdogAuthor Commented:
hi there,
thanks basically what i need is the following
i have two accepted domains on my exchange 2007 server.
i want distribution groups for both companies to include all primary smtp email addresses for that company.
I dont want it to include system and resource email address.
so i was going to apply it to my all company users ou, which i think will filter thgrough the sub domains
0
 
dougdogAuthor Commented:
just to be more clear
i want a distribution list for each compnay based on the users primary email address.
but i dont want it to include all the system and resource email accounts we have setup.
Can i be applied to an ou
if it is applied to an ou does it filter to sub ou etc
0
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

 
DocCan11Commented:
ok.. sorry I did not get back to this sooner.. First the above will search all sub folders.. just give me a bit to work on the other part of the problem..
0
 
DocCan11Commented:
I will post this in a number of replies.. First about your recipients.. the -includedRecipients parameter that I used will not find your system or room or equipment mailboxes.. it only finds users that you have created that have mailboxes.. it will not catch mail enabled users (users that have external addresses).. I can use and OR statement if you need these as well ..

0
 
DocCan11Commented:
make sure you know that it is not the organizationalunit parameter that is catching the users it should find but the -recipientContainer parameter
0
 
DocCan11Commented:
It seems to get exactly what you want you are going to need a combination of both our answers since the command does not allowing a neat piping solution..

new-DynamicDistributionGroup -Name 'test' -RecipientFilter {(WindowsEmailAddress  -like '*@domain.com')} -OrganizationalUnit 'Adatum.com/Legal' -Alias 'test' -RecipientContainer 'Adatum.com/Legal'

now the -organizationalunit parameter is where you want to store the resulting distribution group.. you will need to change the -recipinetcontainer parameter to be the location in AD you want to start your search from.. This should solve it for you ..
0
 
dougdogAuthor Commented:
no problem
thanks so much for youre help so far, the addresses i dont want to include are addresses that i have created however like backup@domainname ups@domainname etc.
these i could put in a seperate ou
would that work
0
 
dougdogAuthor Commented:
im thinking
would it be possiblem to create a dynamic distribution group based on primary smtp address apply it to domain level (that way i would know that all users are being picked up even if they are in the wrong ou.
then try and have a group that is excluded from tghe group which i could put the users and accounts that i dont want in the list ie
excluded users group which contains ups@domain admin@domain enquiry@domain etc
0
 
dougdogAuthor Commented:
anyone
0
 
DocCan11Commented:
sorry I missed this.. I will look at it today
0
 
dougdogAuthor Commented:
no prob
0
 
DocCan11Commented:
I am sorry it has taken so long to reply to this but I have been flying all over the place lately.. Ok.. you can modify the query I gave you above, specifically you will need to modify the following --- RecipientFilter {(WindowsEmailAddress  -like '*@domain.com')} . You can modify it by adding and -AND command

RecipientFilter {(WindowsEmailAddress  -like '*@domain.com') -AND ( (WindowsEmailAddress -ne 'backup@domainname') -OR (WindowsEmailAddress -ne ' ups@domainname ')))}

if you want more examples.. here is a good site..

http://technet.microsoft.com/en-us/library/bb124268(EXCHG.80).aspx

again sorry I was so slow..
0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now