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

LDAP Query to find Groups in AD but Skipping an OU

need to pull a list of all DL from AD but Skip a particular OU

need a LDAP command for it
0
ARM2009
Asked:
ARM2009
  • 2
  • 2
1 Solution
 
Mike KlineCommented:
You could do something like this


get-adgroup -Filter 'GroupCategory -eq "Distribution"' -properties *| Where-Object {$_.DistinguishedName -notlike "*DN of OU*"} | format-list name, groupcategory, groupscope

Thanks

Mike
0
 
ARM2009Author Commented:
i need to filter via LDAP ... not a powershell.
0
 
Mike KlineCommented:
ahhh ok...no way to do that via LDAP.  You can't filter an OU out in an LDAP query.  You can get the groups...I can help with that if you need that query.

Thanks

Mike
0
 
ARM2009Author Commented:
i already have the group query... was looking to skip a certain OU. thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

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