Solved

How to create Dynamic Distribution List Applied to an OU

Posted on 2008-06-18
13
2,214 Views
Last Modified: 2012-05-05
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
Comment
Question by:dougdog
  • 7
  • 6
13 Comments
 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
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
 

Author Comment

by:dougdog
Comment Utility
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
 

Author Comment

by:dougdog
Comment Utility
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
 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
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
 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
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
 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
make sure you know that it is not the organizationalunit parameter that is catching the users it should find but the -recipientContainer parameter
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
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
 

Author Comment

by:dougdog
Comment Utility
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
 

Author Comment

by:dougdog
Comment Utility
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
 

Author Comment

by:dougdog
Comment Utility
anyone
0
 
LVL 6

Expert Comment

by:DocCan11
Comment Utility
sorry I missed this.. I will look at it today
0
 

Author Comment

by:dougdog
Comment Utility
no prob
0
 
LVL 6

Accepted Solution

by:
DocCan11 earned 500 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now