[Webinar] Streamline your web hosting managementRegister Today

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

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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