The Windows Software Development Kit (SDK) for Windows 8 contains headers, libraries, and a selection of tools that you can use when you create applications that run on Windows operating systems. For MI development the SDK includes the Convert-MofToProvider tool that takes a MOF file as input and generates the skeleton code for an MI provider, .NET reference assemblies for MI client development in managed languages such as Microsoft Visual C#, and header files for MI provider and client development in native languages such as Microsoft Visual C++.web
While not strictly required, Visual Studio (including the different editions of Visual Studio Express) creates a rich development environment for coding and debugging MI providers and clients.windows
The current version of MI supports CIM schema 2.26. You'll need to download that schema's MOF files from the DMTF (Distributed Management Task Force) web site.app
If you have downloaded the MI API Samples, you will already have this file. If not, you can create the only needed file from that sample by performing the following steps - as opposed to downloading all of the samples.ide
In your editor, create a new text file.visual-studio
Copy the following contents into the new file:ui
Qualifier Stream : boolean = false, Scope( method, parameter), Flavor(DisableOverride, ToSubclass); Qualifier ClassVersion : string = null, Scope(class, association, indication), Flavor(EnableOverride, Restricted);
Save the file as MSFT_Qualifiers.mof into an appropriate directory. Take note of the directory you use as it will be needed for the Create the Environment Variables section of this topic.this
The following environment variables are used throughout the topics in this section.spa
Note.net
The environment variable values in this section will work for an installation of the Windows SDK where the default installation location was used. If the default installation location was changed during the installation of the Windows SDK, you'll need to use that location in setting the following environment variables.debug
Create an environment variable called SDKDIR and point it to the Windows SDK installation directory. For example:
32-bit (x86): SET SDKDIR=C:\Program Files\Windows Kits\8.0 64-bit (amd64): SET SDKDIR=C:\Program Files (x86)\Windows Kits\8.0
Create an environment variable called SDKMIDOTNETDIR and point it to the location of the MI reference assembly needed for using the MI managed API. For example:
32-bit (x86): SET SDKMIDOTNETDIR=C:\Program Files\Reference Assemblies\Microsoft\WMI\v1.0 64-bit (amd64): SET SDKMIDOTNETDIR=C:\Program Files (x86)\Reference Assemblies\Microsoft\WMI\v1.0
Create an environment variable called SDKBINDER and point it to the Windows SDK bin directory. This will enable you to easily access the Convert-MofToProvider tool. For example:
32-bit (x86): SET SDKBINDIR=%SDKDIR%\bin\x64 64-bit (amd64): SET SDKBINDIR=%SDKDIR%\bin\x32
Create an environment variable called CIM2260DIR and point it to the location where you installed the CIM 2.26 schema files.
SET CIM2260DIR=<Directory containing the CIM 2.26 schema files>
Create an environment variable called MIINCLUDEDIR and point it to the location where you placed the MSFT_Qualifiers.mof file.
SET MIINCLUDEDIR=<Directory containing the MSFT_Qualifiers.mof file>
A Windows Management Infrastructure (MI) provider enables you to define management data and operations that can be performed on that data. For example, you can develop providers for anything that requires some sort of management at the network or enterprise level. This includes hardware such as hard drives, network connections, and printers as well as software settings such as services, drivers, and so forth. Each of this section's topics presents a set of step-by-step instructions that illustrate tasks such as how to build, register, and test an MI Provider using MI tools, Microsoft Visual Studio, and PowerShell.
csdn博客,貌似下載下來沒什麼鳥用: https://so.csdn.net/so/search/s.do?q=wmi&t=blog&u=breaksoftware