LDAP – Computer Query


All Computers
(&(objectcategory=computer)(objectClass=computer))

Windows XP Computers
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows XP*))
 
Windows Server 2003
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=*Server 2003))

Windows 2000 Server
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Server 2000*))

Windows NT
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows NT*))

Windows 2000
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows 2000*))

Windows Server 2003 no Service Packs
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=*Server 2003)(!operatingSystemServicePack=*))

Vista SP1 computers
(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=Service Pack 1))

Recently Modified Computers
"(&(objectCategory=computer)(objectClass=computer)(modifyTimeStamp>=givenTime) )"

Recently Deleted Computers
"(&(objectClass=computer)(isDeleted=TRUE)(whenChanged>=givenTime))"

Inactive Computers
(&(objectCategory=computer)(objectClass=computer)(|(!lastlogon=*)(lastlogon<=givenTime)))

OR
(&(objectCategory=Computer)(lastLogonTimeStamp<=XXXX))

Again this filter uses the Get_60_Day_Interval.vbs script. You will then need to replace XXXX in the filter with that number (e.g. 127578167790000000)

Disabled Computers
"(&(objectCategory=computer)(objectClass=computer)(userAccountControl:1.2.840.113556.1.4.803:=2))"
How it works: The report is generated by querying the Directory Service for all computers with “userAccountControl= ADS_UF_ACCOUNTDISABLE”.

Reference:
. LDAP tips #3: Searching for Computers

Advertisements
This entry was posted in Scripts. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s