LDAP Query to find all Windows Servers in a Domain

Here a quick tutorial on how to grab all the Windows Servers out of your domain:

1 ) Open Active Directory Users and Computers MMC.
2 ) Expand AD Users and Computers.
3 ) Expand the domain you want to create the query in.
4 ) Right click on Saved Queries, Select New->Query.
5 ) Name the query “Windows Servers”.
6 ) Click Define Query button.
7 ) From the Find drop down menu select Custom Search.
8 ) Click on the Advanced tab.
9 ) Paste the following into the “Enter LDAP query:” text box (without the quotes), “(&(objectCategory=computer)(|(operatingSystem=Windows Server*)(operatingSystem=Windows 2000 Server))))))”
10 ) Click OK.
11 ) Click OK.
12 ) Press F5 to refresh query and it will show all the windows servers in your domain, everything from Windows 2000 through 2008.

You can find other examples of queries at: http://www.petri.co.il/software/saved_queries_samples_xml.zip

This entry was posted in Microsoft.

Leave a Reply