Contents of Guy’s Scripting Ezine No 10 – WMI Part 2Note, See more on WMI a whole section here
Why Use WMI Scripts?Firstly, a reminder of the benefits of becoming an expert in WMI scripting. The situation is that you would like to see instant data on your operating system processes. A VBScript would be useful to save those time consuming tasks of sifting through log files. A server technician needs skills from many different areas, learning WMI scripting will help make you an expert on Windows Server 2003. This Week’s SecretThis week I want to show you a hidden treasure in the form of WBEMTEST.EXE (WMI Tester). This weeks mission is to use this scripting tool to discover the names of objects that we can use in our WMI scripts. For example, you may want a script to tell you the free space on each of your disks. By using WBEMTEST we won’t have to guess, the tester will give us the precise spelling. WBEMTEST a built-in utility found in Windows 2000, Windows Server 2003 and surprisingly, its there in XP. (Another surprise is that WBEM stands for Web Based Enterprise Management.) If you are on a different operating system, you can WBMEMTEST.EXETo see the tool, just go the Start (Button), Run, then type – WBEMTEST. A reminder of our mission: To find the precise names of the objects and properties which we will then use to write our VBScripts. Once WBEMTEST has opened, there are two crucial points in mastering this tool. The first point is to know what to put in the Connect, Namespace box.
Here is the the second crucial configuration point. Click on Enum Classes and select Recursive, now you will see hundreds of objects each with tens of properties. I have to confess that when I am in a rush, I click on OK instead of Recursive and am very disappointed. More haste – less speed. So remember Recursive. Guy Recommends: WMI Monitor and It’s Free!Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft’s operating systems. Fortunately, SolarWinds have created a Free WMI Monitor so that you can discover these gems of performance information, and thus improve your scripts. Take the guess work out of which WMI counters to use when scripting the operating system, Active Directory or Exchange Server. Give this WMI monitor a try – it’s free. Download your free copy of WMI Monitor This week’s scriptThe idea behind this week’s script is to use WMI to interrogate the operating system and find out facts that are not easily displayed through a GUI, and certainly not all displayed in one box. If the output of this script gives you just one idea for a script of you own then I will be happy. My point, I am not saying that its not vital to collect ALL this data, however, one or two items in the output may spark an idea for a project. ‘ VBScript to interrogate the operating system Learning Points from the WMI Script
Script to measure free disk spaceHere is that script to measure your free disk space. ‘vbscript to measure the free disk space Challenge.USE WBEMTEST as a launch pad to write your own scripts, and send your best shot to me. Its a strange phenomenon, but what I find is that if write a script that someone else is going use, I make it just that little bit better. If you accept my challenge reply to this email attaching your script as .zip or txt file. Troubleshooting Resources
For much more on WBEMTEST, see my WMI Section here. See More WMI Scripts• WMI • Ezines • WMI Basics • WMI PowerShell • Free SolarWinds WMI Monitor • Ezine 9 WMI • Ezine 10 WMI • Ezine 19 WMI • Ezine 40 Variables • Ezine 48 WMI • Ezine 52 WMI OS • Ezine 76 WMI Classes • Ezine 93 WMI • Ezine 94 WMI • Ezine 95 WMI |