Skip to main content

Invoke-LXCOServerPowerAction

Use this cmdlet to perform a power action (such as power on or power off) on one or more managed servers.

Note
  • You can perform power actions on a maximum of 25 devices at one time. This means that the number of servers in the groups specified GroupIDs parameter or the number of servers specified in ResourceIDs parameter cannot exceed 25 devices.
  • You cannot pipe objects to this cmdlet.

Syntax

Invoke-LXCOServerPowerAction [-Connection LXCOConnection]
-Action String
-ResourcesIDs String[]
[CommonParameter]

Invoke-LXCOServerPowerAction [-Connection LXCOConnection]
-Action String
-GroupsIDs String[]
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Orchestrator server. If no connection is specified, the result from the last Connect-LXCO cmdlet is used.
Action String
Power action to perform on the specified resources.

This can be one of the following values:

  • PowerOn. Powers on the resource.
  • PowerOffImmediately. Powers off the resource immediately.
  • PowerOffNormally. Shuts down the operating system and powers off the resource.
  • RestartImmediately. Restarts the resource immediately.
  • RestartNormally. Shuts down the operating system and restarts the resource.
  • RestartManagementController. Restarts the baseboard management controller.
  • RestartToSystemSetup. Restarts the resource to BIOS/UEFI (F1) Setup. This is supported for non-ThinkServer servers that are supported without limitations.
-ResourcesIDs String
Specifies the server IDs.
-GroupsIDs String
Specifies the device group IDs.
CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

Examples

The following example immediately powers off the specified servers.
$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck

$serverIDs = @(
"AAABBBCCCDDD-45D937C322664C62B238FEE679314F6F",
"EEEFFFDDD000-45D937C322664C62B238FEE679314F6F"
)

$result = Invoke-LXCOServerPowerAction -Action PowerOffImmediately -ResourcesIDs $serverIDs
$result | Format

Disconnect-LXCO