
close
close
These LDAP search strings are good for Saved Queries in Windows Server 2003 AD Users and Computers, Query-based Distribution Groups and Exchange 2000/2003 Recipient Policies and Address Lists. In order to use the LDAP strings please consult your product help.
Most regular LDAP searches can be easily done via the provided GUI (such as in a new Address List filter), however there are instances where the provided GUI does not give us the needed flexibility. For example, you cannot use the GUI to create a search that uses the Boolean word “OR”, you can only create searches that use “AND” as their filter. In those cases, if you wanted to create a filter that finds users that are either in the Sales department OR in the Development department – you’d need to use a manual search string.
Hence the following examples. They are simple, common, day-to-day strings that you might find handy.
Most samples can be used as provided, but some need minor changes, use common sense where needed.
Finally, saves XML samples of the same queries can be downloaded and used directly from the Saved Queries folder in the Windows Server 2003 AD Users and Computers.
(&(objectCategory=computer)(operatingSystemVersion=4*)(userAccountControl:1.2.840.113556.1.4.803:=8192))
Notice the “!” that means “NOT”.
advertisment
(objectCategory=computer)(!description=*)
(objCategory=group)(description=*)
Notice the “|” that means “OR”.
(objectCategory=group)(|(cn=QA*)(cn=HD*))
Notice the “|” that means “OR”.
(|(department=Sales)(company=Sales)(description=Sales))
(objectCategory=user)(whenCreated>=20040801000000.0Z)
Notice the “!” that means “NOT”.
(objectCategory=user)(!cn=sara*)
Notice the “>=” that means “Greater than or equal to”.
advertisment
(objectCategory=user)(badPwdCount>=2)
(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))
(&(objectCategory=person)(objectClass=user)(lockoutTime>=1))
(objectCategory=user)(memberOf=CN=QA Users,OU=Help Desk,DC=dpetri,DC=net)
(objectClass=user)(mail=*)
(objectClass=user)(email=*)
Note: Download the datetointeger8.zip script to help you generate this date format.
(&(objectCategory=person)(objectClass=user)(pwdLastSet
More from Daniel Petri
advertisment
Petri Newsletters
Whether it’s Security or Cloud Computing, we have the know-how for you. Sign up for our newsletters here.
advertisment
More in Exchange Server
Microsoft to Ship Some Exchange Server Security Updates in .EXE Packages
May 11, 2022 | Rabia Noureen
M365 Changelog: Exchange Transport Rule Report moving to the new Exchange Admin Center (EAC) from the Security and Compliance Center
Apr 22, 2022 | Petri Staff
M365 Changelog: (Updated) Change to mailbox forwarding behavior coming to Exchange Online
Apr 21, 2022 | Petri Staff
M365 Changelog: (Updated) Microsoft Defender for Office 365: Updates to URL Protection Report
Apr 21, 2022 | Petri Staff
Most popular on petri
Log in to save content to your profile.
Article saved!
Access saved content from your profile page. View Saved
Join The Conversation
Create a free account today to participate in forum conversations, comment on posts and more.
Copyright ©2019 BWW Media Group