Friday, April 10, 2020

LDAP Query for Active Windows Client Workstations

If you are using ADUC or a security scan engine tool, this is how you can limit to searches for active machines.

Copy and paste the text into a custom search in ADUC or whatever you need it for.

(&(&(&(objectCategory=computer)(objectClass=computer)(|(operatingSystem=Windows\2010*)(operatingSystem=Windows\207*))(!userAccountControl:1.2.840.113556.1.4.803:=2))))

The "\20" is a placeholder for a space.  If you need to add other operating systems, add another "(operatingSystem=Windows\207*)" after it. 

XP: 
(operatingSystem=Windows\20XP*)