Take Advantage of Scriptomatic 2.0 to Maximize Your WMI Scripting Efforts
http://windowsitpro.com/article/articleid/44360/take-advantage-of-scriptomatic-20-to-maximize-your-wmi-scripting-efforts.html
The simplest and most obvious use for Scriptomatic is reading and displaying a class's properties and their values. When Scriptomatic 2.0 loads, it defaults to the root\CIMV2 namespace, then loads the classes in that namespace. You select a WMI class, such as Win32_ComputerSystem, to generate a script.
After Scriptomatic 2.0 generates the code, you can immediately run the script or save it to a file so that you can use it to create more complex code. If you run the script, you can output the results as command output in the command-shell window, as a text file for viewing in Notepad or another editor, as an HTML or XML file for viewing in a browser such as Microsoft Internet Explorer (IE), or as a comma-separated value (CSV) file for viewing in Microsoft Excel or another spreadsheet program.
Scriptomatic 2.0 alone won't give you a complete picture, which is why you need several WMI-specific tools and references in your toolkit. Here's a list of essential WMI tools and documentation that you can use to expand on the information Scriptomatic 2.0 provides:
- WBEMTest. WBEMTest is part of every OS installed with WMI. It's not the easiest tool to master, but it has the advantage of always being there.
- WMI CIM Studio. WMI CIM Studio is a powerful and intuitive Web-based interface for digging into WMI. It's part of the WMI
- Administrative Tools suite. Those who don't already have this suite of tools can download it from http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=6430f853-1120-48db-8cc5-f2abdc3ed314.
- WMI software development kit (SDK) documentation. The WMI SDK documentation is available online at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp. If you don't have an always-on Internet connection, you might prefer to download the Windows Server 2003 Core SDK from http://www.microsoft.com/msdownload/platformsdk/sdkupdate. The WMI SDK documentation is part of the Core SDK.
- "WMI Scripting Primer." I often reference the three-part article "WMI Scripting Primer" because, in relatively few pages, it provides powerful insights into the WMI architecture and the WMI scripting API. If you haven't already read this primer, I urge you to do so. "WMI Scripting Primer: Part 1" is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting06112002.asp. You can access the other parts from the directory on the right side of this Web page.
Using Contrast as an Effective Learning Tool
Scriptomatic 2.0 lets you select other WMI namespaces besides the common root\CIMV2 namespace. CIMV2 is the only namespace available in version 1.0. In version 2.0, you can gain insight on whether a namespace (i.e., provider) is available on other platforms. For example, the root\MicrosoftIISv2 provider is available on Windows 2003 computers running Microsoft IIS 6.0. In contrast, this namespace isn't available on computers running Windows XP and IIS 5.1 because the MicrosoftIISv2 provider is available only on IIS 6.0.
Download Scriptomatic 2.0:
No comments:
Post a Comment