Редактиране

Споделяне чрез


WMI tasks for scripts and applications

The following sections describe various computer and network administration tasks and provide links to the WMI class or classes used to perform those tasks. For more information, see Creating a WMI Application or Script. For more info about using WMI, see Further information.

(These resources might not be available in every language or country/region.)

For more information about how to provide data to WMI, see Using WMI, which will reference topics about writing a WMI provider.

The operations shown in script examples can be performed by applications in C++ or Visual Basic. For more information, see Creating a WMI Application Using C++ and WMI C++ Application Examples.

The following table lists the categories of tasks.

Task Categories Description
Accounts and Domains Obtain information such as the computer domain or the currently logged-on user. Many domain- or account-related tasks are best performed with ADSI scripts. For examples, see the TechNet ScriptCenter.
Computer Hardware Obtain information about the presence, state, or properties of hardware components. For example, you can determine whether a computer is a desktop or laptop.
Computer Software Obtain information such as which software is installed by the Windows Installer (MSI) and software versions.
Connecting to the WMI Service To get data from WMI, either on the local computer or from a remote computer, you must connect to the WMI service by connecting to a specific namespace. In most cases, use either the shorthand moniker connection or the Locator connection.
Dates and Times There are WMI classes and a scripting object to parse or convert the CIM datetime format.
Desktop Management Obtain data from or control remote desktops. For example, you can determine whether or not the screensaver requires a password. WMI also gives you the ability shut down a remote computer.
Disks and File Systems Obtain information about disk drive hardware state, logical volumes.
Event Logs Obtain event data from NT Event log files and perform operations like backing up or clearing log files.
Files and Folders Change file or folder properties through WMI, including creating a share or renaming a file.
Networking Manage and obtain information about connections and IP or MAC addresses.
Operating Systems Obtain information about the operating system such as version, whether it is activated, or which hotfixes are installed.
Performance Monitoring Use the WMI classes that obtain data from performance counters to access and refresh data about computer performance.
Processes Obtain information such as the account under which a process is running. You can perform actions like creating processes.
Printers and Printing Manage and obtain data about printers, such as finding or setting the default printer.
Registry Create and modify registry keys and values.
Scheduled Tasks Create and get information about scheduled tasks.
Services Obtain information about services, including dependent or antecedent services.