Generate a list of the servers in your Active Directory (from cmd line)
Want to quickly generate a list of all of the servers located in your Active Directory? Get adfind.exe from www.joeware.net, and then from a cmd prompt, do:
adfind -config -f “objectclass=server” -nodn name -csv -csvnoq > serverList.ini
This will create a list of all servers in your environment, and put them in a file called serverList.ini. You’ll need to edit it later and remove the first line, which will contain the column heading, ‘name’. You may have some policies listed also that’ll need to get removed, since they may match the filter above.
I’ll try to blog more about various useful queries you can do against your AD - I highly recommend familiarizing yourself with the adfind.exe utility, it’s quite a gem.
