Skip to main content

Invoke-LXC1DevicePowerAction

This cmdlet starts a job to perform a power action on the specified devices.

Note
  • When performing power actions on a large number of devices, multiple requests are generated.

  • You cannot pipe objects to this cmdlet.

Syntax

Invoke-LXC1DevicePowerAction  -DeviceIDs String[]
-PowerAction String
[-Connection LXC1Connection]
[CommonParameter]
Parameters
-DeviceIDs String[]
Specifies one or more device IDs.
-PowerAction String
Specifies the power action to perform on the devices. This can be one of the following values.
  • powerOn. Powers on the device.

  • powerOffNormally. Shuts down the operating system (if applicable), and then powers off the device.

  • powerOffImmediately. Powers off the device immediately.

  • restartNormally. Shuts down the operating system (if applicable), and then restarts the device.

  • restartImmediately. Restarts the device immediately.

  • restartSystemSetup. Restarts the device to BIOS/UEFI (F1) Setup.

  • restartManagementController. Restarts the baseboard management controller.

-Connection LXC1Connection
Specifies the connection to the XClarity One server. If no connection is specified, the result from the last Connect-LXC1 cmdlet is used.
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 starts the power job for the specified devices..
param ( 
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)

$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword))
$hostOnprem = "192.0.2.0"

$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck

$result = Invoke-LXC1DevicePowerAction -DeviceIDs "E1E078F0728C11EC88AB52540029A690-D0B59E15309447928C11AF7D84730D0E" `
-PowerAction restartManagementController
$result