In PowerShell, Get-WMIObject is a terrific cmdlet for remotely managing systems. If you have a text list of server or computer names, here’s a quick method you could enumerate that list and do something to each server. foreach ($server in (Get-Content s:\servers.txt)) {#skip blank lines if (($server).length -gt 0) { $server Get-WmiObject win32_operatingsystem -computer $server.Trim()}…
Tag: WMI
Advanced VBScript Text Stats
Amazon is always coming up with new ways to look at books and buying habits. The latest I came across are text stats. For books where they have access to the content, Amazon will process the text and come up with stats for things like complexity and readability. Because Amazon has the entire Advanced VBScript…
Introduction to WMIC
WMIC – An IntroductionWindows Management Instrumentation (WMI) is an extremely powerful technology that provides tremendous detail on how a computer system is configured and operating. What makes WMI so attractive to Windows administrators is that you don’t have to be a programmer to leverage it. WMI is available as a scripting option. There are many…
Techmentor: WMIC Examples
I didn’t get a chance to run through the WMIC examples. The Advanced VBScript book covers this topic in a little more detail. I also have a short PDF intro on WMIC you can download at http://www.jdhitsolutions.com/tutorials.htm Before you run any examples, you need to “install” WMIC. This basically means at a command prompt type…
Get Percent Free Space
I’ve put together a function that will return the percentage free space on a given logical drive for a specified server. The function in the following script is really doing all the hard work. The rest of the script is simply a demonstration on how to call the function. The script uses WMI and queries…
Finding Service Uptime
Ever wonder how long a particular service has been running? With WMI you can come pretty close to getting a handle on this. We start with Win32_Service to get the current process handle. Once we have that, we can query the Win32_Process class and get the creation time for that particular process. You need to…