ManagementObject 参数 WMI 一些参数(Win32_Service) (转载ltbing cnblogs)

来源:百度文库 编辑:神马文学网 时间:2024/07/03 08:35:02
本文转载处:http://blog.csdn.net/ltbing/archive/2006/07/31/1005460.aspx
class Win32_Service : Win32_BaseService
{
booleanAcceptPause;
booleanAcceptStop;
stringCaption;
uint32CheckPoint;
stringCreationClassName;
stringDescription;
booleanDesktopInteract;
stringDisplayName;
stringErrorControl;
uint32ExitCode;
datetimeInstallDate;
stringName;
stringPathName;
uint32ProcessId;
uint32ServiceSpecificExitCode;
stringServiceType;
booleanStarted;
stringStartMode;
stringStartName;
stringState;
stringStatus;
stringSystemCreationClassName;
stringSystemName;
uint32TagId;
uint32WaitHint;
};
Properties
The Win32_Service class has the following properties.
Data type: boolean
Access type: Read-only
Service can be paused.
Data type: boolean
Access type: Read-only
Service can be stopped.
Data type: string
Access type: Read-only
Short description of the object—a one-line string.
Data type: uint32
Access type: Read-only
Value that the service increments periodically to report its progress during a long start, stop, pause, or continue operation. For example, the service increments this value as it completes each step of its initialization when it is starting up. The user interface program that invokes the operation on the service uses this value to track the progress of the service during a lengthy operation. This value is not valid and should be zero when the service does not have a start, stop, pause, or continue operation pending.
Data type: string
Access type: Read-only
Qualifiers:Key, MaxLen(256)
Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, the property allows all instances of this class and its subclasses to be uniquely identified.
Data type: string
Access type: Read-only
Description of the object.
Data type: boolean
Access type: Read-only
Service can create or communicate with windows on the desktop.
Data type: string
Access type: Read-only
Display name of the service. This string has a maximum length of 256 characters. The name is case-preserved in the Service Control Manager. However, DisplayName comparisons are always case-insensitive. Constraint: accepts the same value as the Name property.
Example: "Atdisk"
Data type: string
Access type: Read-only
Severity of the error if this service fails to start during startup. The value indicates the action taken by the startup program if failure occurs. All errors are logged by the computer system.
Value Meaning
"Ignore" User is not notified.
"Normal" User is notified.
"Severe" System is restarted with the last-known-good configuration.
"Critical" System attempts to restart with a good configuration.
"Unknown" Severity of the error is unknown.
Data type: uint32
Access type: Read-only
Windows error code defining any problems encountered in starting or stopping the service. This property is set to ERROR_SERVICE_SPECIFIC_ERROR (1066) when the error is unique to the service represented by this class, and information about the error is available in the ServiceSpecificExitCode property. The service sets this value to NO_ERROR when running, and again upon normal termination.
Data type: datetime
Access type: Read-only
Date object is installed. This property does not need a value to indicate that the object is installed.
Data type: string
Access type: Read-only
Unique identifier of the service that provides an indication of the functionality that is managed. This functionality is described in more detail in the Description property of the object.
Data type: string
Access type: Read-only
Fully-qualified path to the service binary file that implements the service.
Example: "\SystemRoot\System32\drivers\afd.sys"
Data type: uint32
Access type: Read-only
Process identifier of the service.
Example: 324
Data type: uint32
Access type: Read-only
Service-specific error code for errors that occur while the service is either starting or stopping. The exit codes are defined by the service represented by this class. This value is only set when the ExitCode property value is ERROR_SERVICE_SPECIFIC_ERROR (1066).
Data type: string
Access type: Read-only
Type of service provided to calling processes.
Values are:
"Kernel Driver"
"File System Driver"
"Adapter"
"Recognizer Driver"
"Own Process"
"Share Process"
"Interactive Process"
Data type: boolean
Access type: Read-only
Service has been started.
Data type: string
Access type: Read-only
Start mode of the Windows base service.
Value Meaning
"Boot" Device driver started by the operating system loader (valid only for driver services).
"System" Device driver started by the operating system initialization process. This value is valid only for driver services.
"Auto" Service to be started automatically by the service control manager during system startup.
"Manual" Service to be started by the service control manager when a process calls theStartService method.
"Disabled" Service that cannot be started.
Data type: string
Access type: Read-only
Account name under which a service runs. Depending on the service type, the account name may be in the form of DomainName\Username. The service process is logged by using one of these two forms when it runs. If the account belongs to the built-in domain, then .\Username can be specified. For kernel or system level drivers, StartName contains the driver object name (that is, \FileSystem\Rdr or \Driver\Xns) which the input and output (I/O) system uses to load the device driver. Additionally, if NULL is specified, the driver runs with a default object name created by the I/O system based on the service name.
Example: "DWDOM\Admin"
Windows XP:  You may use UPN format (Username@DomainName) to specify the .Windows 2000:  To change from a specified user to the LocalSystem account, use .\LocalSystem.
Data type: string
Access type: Read-only
Current state of the base service.
Values are:
"Stopped"
"Start Pending"
"Stop Pending"
"Running"
"Continue Pending"
"Pause Pending"
"Paused"
"Unknown"
Data type: string
Access type: Read-only
Current status of the object. Various operational and non-operational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard drive, may be functioning properly but predicting a failure in the near future). Non-operational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither "OK" nor in one of the other states.
Values are the following:
"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
Data type: string
Access type: Read-only
Type name of the system that hosts this service.
Data type: string
Access type: Read-only
Name of the system that hosts this service.
Data type: uint32
Access type: Read-only
Unique tag value for this service in the group. A value of 0 (zero) indicates that the service does not have a tag. A tag can be used to order service startup within a load order group by specifying a tag order vector in the registry located at: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GroupOrderList. Tags are only evaluated for Kernel Driver and File System Driver start type services that have Boot or System start modes.
Data type: uint32
Access type: Read-only
Estimated time required (in milliseconds) for a pending start, stop, pause, or continue operation. After the specified amount of time has elapsed, the service makes its next call to the method with either an incremented CheckPoint value or a change in CurrentState. If the amount of time specified by WaitHint passes, and CheckPoint has not been incremented, or CurrentState has not changed, the service control manager or service control program assumes that an error has occurred.