So a common issue I run into with clients is that they don't have a good handle on their servers. Recently the problem is "Are there any 2003 servers that I have forgotten about?" If the servers are AD joined this is pretty easy to answer since the computer object has a property called 'OperatingSystem' that contains the OS version. Great but how do I get that data into a useable format?
Well PowerShell comes to the rescue to automate gathering the information into a .csv that you can open in Excel and format it to an easily consumable file!
The script I wrote simply grabs all the computer objects in AD that contain an OS of "*SERVER*", and then test if the server is alive by using the Test-Connection command. Now with a list of the live servers we can connect to all of them using WMI to grab the information that you need. I needed the Hostname, MAC address, IP address, and any DNS servers configured but you can add what ever you need that is exposed by WMI!
All the info collected is output to a simple CSV file that you can open in Excel and make pretty and get some nice reports from.
Here's a link to the script at GitHub:
https://github.com/mikecessna/ActiveDirectoryScripts.git