Create a Dynamic distribution group with excluding an OU

Hi


I am looking to set up a New Dynamic distribution group but I would like to exclude a entire OU.  is there an easy way of setting this up with out using Custom attributes?


Please let me know
LVL 4
SEHCAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Chris DentConnect With a Mentor PowerShell DeveloperCommented:
Nope. None of the filter options will allow you to filter against OU because it's not an attribute of the user. All attributes which do hold that (such as distinguishedName and canonicalName) do not allow wild card filtering (meaning you can't target the parent OU of a user).

Chris
0
 
Jian An LimConnect With a Mentor Solutions ArchitectCommented:
the only way to get it is to insert a custom attribute to the user based

For example Get-Mailbox -OrganizationalUnit "OU=BLOCK,DC=ABC,DC=Lock" | Set-Mailbox -CustomAttribute1 "BlockDDL"

Then you create the DDL filter to exclude CustomAttribute1  -notlike (-ne) "BlockDDL"  (it can be any CustomAttribute )

This is not ideal but kind of achieve what you want
0
 
SEHCAuthor Commented:
HI

can I set it up and just skip a OU entirely?  or this can not be done as well because I would like to not have to manage this on a daily bases
0
 
Chris DentPowerShell DeveloperCommented:
No because there is nothing that will let you filter out an OU, no attribute holds a user (or other AD objects) parent OU.

Your only choice is to populate some other attribute with something you can filter on and maintain that.

Chris
0
 
SEHCAuthor Commented:
HI

how would I set the New-DynamicDistributionGroup to not equals to ??? can you send me the syntax
0
All Courses

From novice to tech pro — start learning today.