Link to home
Start Free TrialLog in
Avatar of crp0499
crp0499Flag for United States of America

asked on

Powershell help in Exchange 2013

I need to create a Dynamic Distribution Lists of people in several OUs.  I see in the GUI that I can only specific one OU and I need to make sure the DDL contains users in several OUs and I think PS can do it.  

Can someone assist me with the syntax please?

I need a DDL consisting of users in multiple OUs in AD.

Thanks

Cliff
Avatar of jmac44
jmac44
Flag of United States of America image

Distribution List or Group? This will link will show you how to do it using a group. Hope that helps.
https://www.interfacett.com/blogs/using-powershell-to-manage-dynamic-distribution-groups-and-recipient-filters-in-exchange-server/

Also this will show you how to convert DDL's to DDG's
http://msexchangeguru.com/2014/08/19/ddg/
Avatar of crp0499

ASKER

I need a Dynamic Dist List for email.  I was also hoping for some sample code like new-distributiongroup  "nationwide" -recipientcontainer thisOU AND thisOU AND thisOU....

something like that.   The GUI only lets you pick one OU.  I need to pick several.
Avatar of crp0499

ASKER

This is what I'm using and it's not working:

New-DynamicDistributionGroup -Name "NationWide" -Alias "NationWide" -RecipientFilter{(((recipienttype -eq 'usermailbox') -and ((RecipientContainer -eq 'domain.local/people/working') )) )}
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial