Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • 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

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

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