Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

LDAP Query to find Groups in AD but Skipping an OU

Posted on 2013-12-12
4
Medium Priority
?
290 Views
Last Modified: 2014-01-16
need to pull a list of all DL from AD but Skip a particular OU

need a LDAP command for it
0
Comment
Question by:ARM2009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Mike Kline earned 750 total points
ID: 39714530
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
 

Author Comment

by:ARM2009
ID: 39714572
i need to filter via LDAP ... not a powershell.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 39714580
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
 

Author Comment

by:ARM2009
ID: 39714681
i already have the group query... was looking to skip a certain OU. thanks
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question