I Need To Make A Change With My IT Support! Call (225) 706-8414

List all Windows servers in Active Directory

So you have an Active Directory (AD) network and somebody has unwisely put every single computer, including the servers, into the default Computers OU. You now need to list out the entries that are servers, ignoring the much larger set of workstations.


You can use an AD LDAP query for this. The query, taken from a Developer’s Closet post, is:


You can run this via Active Directory Users and Computers (ADUC) or ldifde, as we do below:

C:>ldifde -f output.ldf -d dc=example,dc=com -r “(&(objectclass=computer)(objectcategory=computer)(operatingSystem=*Server*)(cn=*))” -l cn


Concerned About Cyber Attacks?


Want to Migrate to the Cloud?

Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!