Tackling Windows Management Instrumentation in Visual Basic .NET

Print Data Matrix 2d barcode in Visual Basic .NET Tackling Windows Management Instrumentation

Tackling Windows Management Instrumentation
Making DataMatrix In Visual Basic .NET
Using Barcode generation for Visual Studio .NET Control to generate, create Data Matrix image in VS .NET applications.
www.OnBarcode.com
Data Matrix 2d Barcode Scanner In VB.NET
Using Barcode scanner for VS .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
11.3 The bad news about WMI
Code 39 Full ASCII Creator In VB.NET
Using Barcode maker for .NET framework Control to generate, create Code-39 image in VS .NET applications.
www.OnBarcode.com
Printing Linear In Visual Basic .NET
Using Barcode generator for Visual Studio .NET Control to generate, create Linear 1D Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
Unfortunately, for most of its life (the situation has recently changed), Microsoft didn t exercise a lot of internal controls over WMI. They established a set of programming standards, but the product groups were more or less left to their own devices for how they implemented classes and whether or not they chose to document them. The result is that WMI can be a confusing mishmash. Within the root\CIMv2 namespace, for example, very few classes have any methods that allow you to change configuration settings. Properties are read-only, meaning that you must have a method to make changes; if a method doesn t exist, you can t use WMI to make changes for that class. When the IIS team adopted WMI (for IIS version 6), they implemented parallel classes for a lot of elements. A website, for example, could be represented by one class that had the typical read-only properties, but also by a second class that had writable properties that you could change. Very confusing and the confusion was made worse by the fact that there wasn t any good documentation on how to use those classes, because the IIS team originally intended them to be used mainly by their own tools, not directly by administrators. There s no rule saying that a product has to use WMI, or that if it does use WMI that it must expose every possible component through WMI. Microsoft s DHCP server is inaccessible to WMI, as is its old WINS server. Although you can query the configuration of a network adapter, you can t retrieve its link speed, because that information isn t supplied. Although most of the Win32_ classes are well documented, few of the classes in other namespaces are documented at all. WMI isn t searchable, so the process of finding the class that you need can be time-consuming and frustrating (although I ll try to help with that in the next section). The WMI repository the place where Windows keeps all the WMI information can also become corrupted, and that seems to occur a lot more on client computers than on servers. You might not even notice the problem unless you re using System Center Configuration Manager, which relies heavily on WMI and can t inventory computers properly when the repository becomes corrupted. If you find yourself in possession of a corrupted repository, check out the Repairing and re-registering the WMI article on Ramesh Srinivasan s Troubleshooting Windows blog (http:// windowsxp.mvps.org/repairwmi.htm), which provides a good overview of what steps to take, and in what order. Rebuilding the repository isn t ever a good first step, but it s sometimes necessary, and that article will walk you through the process. You can also hit your favorite search engine with a search like wmi repository corrupted and you ll get a number of useful links and tools to try. Microsoft claims to have corrected the major corruption issues in Windows 7. The good news is that Microsoft is making an effort to provide PowerShell cmdlets for as many administration tasks as possible. For example, WMI used to be the only practical way to programmatically restart a remote computer, using a method of the Win32_OperatingSystem class. Now, PowerShell provides a Restart-Computer cmdlet.
GTIN - 12 Maker In VB.NET
Using Barcode generation for VS .NET Control to generate, create UCC - 12 image in .NET applications.
www.OnBarcode.com
Code 128 Code Set B Creator In Visual Basic .NET
Using Barcode encoder for .NET Control to generate, create Code 128 image in Visual Studio .NET applications.
www.OnBarcode.com
Exploring WMI
EAN / UCC - 13 Drawer In Visual Basic .NET
Using Barcode drawer for .NET Control to generate, create EAN-13 Supplement 5 image in Visual Studio .NET applications.
www.OnBarcode.com
Uniform Symbology Specification Code 93 Creator In VB.NET
Using Barcode maker for Visual Studio .NET Control to generate, create ANSI/AIM Code 93 image in Visual Studio .NET applications.
www.OnBarcode.com
In some cases, cmdlets will use WMI internally, but you won t have to deal with WMI directly in those cases. Cmdlets can provide a more consistent interface for you, and they re almost always better documented. WMI isn t going away, but over time you ll probably have to deal with it and its eccentricities a lot less.
Data Matrix ECC200 Generation In Java
Using Barcode encoder for Java Control to generate, create DataMatrix image in Java applications.
www.OnBarcode.com
DataMatrix Printer In Java
Using Barcode encoder for BIRT reports Control to generate, create Data Matrix image in Eclipse BIRT applications.
www.OnBarcode.com
11.4 Exploring WMI
DataMatrix Drawer In None
Using Barcode drawer for Microsoft Word Control to generate, create DataMatrix image in Microsoft Word applications.
www.OnBarcode.com
Painting UPC Symbol In Java
Using Barcode printer for Java Control to generate, create UPCA image in Java applications.
www.OnBarcode.com
Perhaps the easiest way to get started with WMI is to put PowerShell aside for a second and explore WMI on its own. I use a free WMI Explorer tool that I downloaded from Sapien (http://www.primaltools.com/downloads/communitytools/); the tool doesn t require installation, which means you can easily copy it to a USB flash drive and carry it to whatever computer you re interested in. Because each computer can have different WMI stuff, you ll want to run the tool directly on whatever computer you re planning to query, so that you can see that computer s WMI repository. I locate most of what I need in WMI with this tool. It does require a lot of browsing and patience I m not pretending this is a perfect process but it eventually gets me there. Figure 11.1 shows an example. Let s say I needed to query a bunch of client computers and see what their icon spacing is set to. That s something that has to do with the Windows desktop, and
Data Matrix Encoder In Visual Studio .NET
Using Barcode creation for VS .NET Control to generate, create DataMatrix image in Visual Studio .NET applications.
www.OnBarcode.com
Drawing Barcode In Objective-C
Using Barcode printer for iPhone Control to generate, create Barcode image in iPhone applications.
www.OnBarcode.com
Making Data Matrix In Java
Using Barcode encoder for Android Control to generate, create Data Matrix 2d barcode image in Android applications.
www.OnBarcode.com
Reading Code128 In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
PDF-417 2d Barcode Generator In .NET Framework
Using Barcode drawer for VS .NET Control to generate, create PDF-417 2d barcode image in VS .NET applications.
www.OnBarcode.com
Code 3 Of 9 Generation In None
Using Barcode creation for Font Control to generate, create Code 39 Full ASCII image in Font applications.
www.OnBarcode.com
Making Data Matrix ECC200 In .NET
Using Barcode encoder for Reporting Service Control to generate, create ECC200 image in Reporting Service applications.
www.OnBarcode.com
Generating EAN128 In .NET Framework
Using Barcode drawer for ASP.NET Control to generate, create UCC.EAN - 128 image in ASP.NET applications.
www.OnBarcode.com
Copyright © OnBarcode.com . All rights reserved.