Share via


SetPowerState method of the MSCluster_Node class

Defines the desired power state of a ComputerSystem and its running OperatingSystem, and when the system should be put into that state. The PowerState parameter is specified as one of the valid integer values defined for the property, PowerState. The Time parameter (for all state changes but 5, "Power Cycle") indicates when the power state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received). When the PowerState parameter is equal to 5, "Power Cycle", the Time parameter indicates when the system should power on again. Power off is immediate. SetPowerState should return 0 if successful, 1 if the specified State and Time request is not supported, and some other value if any other error occurred.

Syntax

uint32 SetPowerState(
  [in] uint16   PowerState,
  [in] datetime Time
);

Parameters

PowerState [in]

Specifies the power operation.

Unknown (0)

Full Power (1)

Power Save - Low Power Mode (2)

Power Save - Standby (3)

Power Save - Unknown (4)

Power Cycle (5)

Power Off (6)

Power Save - Warning (7)

Time [in]

Indicates when the power state should be set, either as a regular date-time value or as an interval value (where the interval begins when the method invocation is received). When the PowerState parameter is equal to 5, "Power Cycle", the Time parameter indicates when the system should power on again. Power off is immediate.

Return value

Returns 0 if successful, 1 if the specified power state and time requests are not supported, and some other value if any other error occurred.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2012
Namespace
Root\MSCluster
MOF
ClusWMI.mof
DLL
ClusWMI.dll

See also

MSCluster_Node