windows:ad:aduc

Active Directory Users and Computers custom LDAP query

  1. Right click on 'Saved Queries'
  2. New → Query
  3. Enter name
  4. Click 'Define Query'
  5. Select 'Custom Search'
  6. Click 'Advanced' tab
  7. Enter query and confirm
  • (&(samAccountName=*)(objectCategory=user)) All users
  • (&(samAccountName=*)(objectCategory=user)(memberOf=cn=Domain Admins,CN=Users,DC=example,DC=com)) All users in group 'Domain Admins'
  • (&(objectCategory=person)(userAccountControl:1.2.840.113556.1.4.803:=65536)) Users with valid password expiry
  • (objectCategory=person)(objectClass=user)(pwdLastSet=0)(!useraccountcontrol:1.2.840.113556.1.4.803:=2) Users with expiring password
  • (objectCategory=person)(objectClass=user)(useraccountcontrol:1.2.840.113556.1.4.803:=2) All disabled users
  • (objectCategory=person)(objectClass=user)(!useraccountcontrol:1.2.840.113556.1.4.803:=2) All enabled users
  • (objectcategory=person)(!mail=*) Users with no email address
  • (&(&(objectCategory=person)(objectClass=user))(|(lastLogon=0)(!(lastLogon=*)))) Users who never loged in
  • (&(objectCategory=computer)(servicePrincipalName=MSSQLSvc*)(operatingSystem=Windows Server*)) All servers with SQL
  • (&(objectCategory=computer)(servicePrincipalName=MSSQLSvc*)(operatingSystem=Windows Server 2003)) All Windows 2003 servers with SQL
  • (&(samAccountName=*)(objectCategory=computer)) All computers
  • (&(objectCategory=computer)(operatingSystem=Windows 2000*)) All Windows 2000 computers
  • (&(objectCategory=computer)(operatingSystem=Windows XP*)) All Windows XP computers
  • (&(objectCategory=computer)(operatingSystem=Windows XP*)(!operatingSystemServicePack=*)) All Windows XP computers with no service pack
  • (&(objectCategory=computer)(operatingSystem=Windows XP*)(operatingSystemServicePack=Service Pack 1)) All Windows XP computers with SP1
  • (&(objectCategory=computer)(operatingSystem=Windows XP*)(operatingSystemServicePack=Service Pack 2)) All Windows XP computers with SP2
  • (&(objectCategory=computer)(operatingSystem=Windows XP*)(operatingSystemServicePack=Service Pack 3)) All Windows XP computers with SP3
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2003)) All Windows 2003 computers
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2003)(!operatingSystemServicePack=*)) All Windows 2003 computers with no service pack
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2003)(operatingSystemServicePack=Service Pack 1)) All Windows 2003 computers with SP1
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2003)(operatingSystemServicePack=Service Pack 1)) All Windows 2003 computers with SP2
  • (&(objectCategory=computer)(operatingSystem=Windows Vista*)) All Windows Vista computers
  • (&(objectCategory=computer)(operatingSystem=Windows Vista*)(!operatingSystemServicePack=*)) All Windows Vista computers with no service pack
  • (&(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=Service Pack 1)) All Windows Vista computers with SP1
  • (&(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=*)) All Windows Vista computers with SP2
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2008*)) All Windows 2008 computers (including R2)
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2008*)(!operatingSystemServicePack=*)) All Windows 2008 computers with no service pack
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2008*)(operatingSystemServicePack=Service Pack 1)) All Windows 2008 computers with SP1
  • (&(objectCategory=computer)(operatingSystem=Windows Server 2008*)(operatingSystemServicePack=Service Pack 2)) All Windows 2008 computers with SP2
  • (&(objectCategory=computer)(operatingSystem=Windows 7*)) All Windows 7 computers
  • (&(objectCategory=computer)(operatingSystem=Windows 7*)(!operatingSystemServicePack=*)) All Windows 7 computers with no service pack
  • (&(objectCategory=computer)(operatingSystem=Windows 7*)(operatingSystemServicePack=Service Pack 1)) All Windows 7 computers with SP1
  • (&(objectCategory=computer)(operatingSystem=Windows 8*)(!operatingSystem=Windows 8.1*)) All Windows 8 computers
  • (&(objectCategory=computer)(operatingSystem=Windows 8.1*)) All Windows 8.1 computers
  • (&(objectCategory=computer)(operatingSystem=Windows 10*)) All Windows 10 computers
  • (&(&(&(objectCategory=Person)(objectClass=User)(lockoutTime>=1)))) All locked users
  • windows/ad/aduc.txt
  • Last modified: 2021/04/01 14:21
  • by 127.0.0.1