2013 Scripting Games: Beginner Event 2

Doctor Scripto

Summary: Dr. Scripto needs to find basic information from his servers. Microsoft Scripting Guy, Ed Wilson, is here. Welcome to Week 2 of the 2013 Scripting Games. Just in case you are not up to speed, this year The Scripting Guys are not hosting the Scripting Games. They are being hosted at www.powershell.org. I am in full support of the Games, and I am posting the events here for your perusal. However, if you would like to submit an entry to the event, you must go to www.powershell.org.

An Inventory Intervention

Dr. Scripto finally has the budget to buy a few new virtualization host servers, but he needs to make some room in the data center to accommodate them. He thinks it makes sense to get rid of his lowest-powered old servers first…but he needs to figure out which ones those are. All of the virtualization hosts run Windows Server, but some of them don’t have Windows PowerShell installed, and they’re all running different operating system versions. The oldest operating system version is Windows 2000 Server (he knows, and he’s embarrassed, but he’s just been so darned busy). The good news is that they all belong to the same domain, and that you can rely on having a Domain Admin account to work with. The good Doctor has asked you to write a Windows PowerShell command or script that can show him each server’s name, the installed version of Windows, amount of installed physical memory, and number of installed processors. For processors, he’ll be happy to get a count of cores, or sockets, or even both—whatever you can reliably provide across all these different versions of Windows. To help you out, he’s given you a text file, C:IPList.txt, which contains one server IP address per line. If you can write this as a one-liner, awesome! If not, try to keep your answer as concise and compact as possible (although it’s perfectly okay to use full command and parameter names). I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy