Skip to content

Set HPOVServerPower

Chris Lynch edited this page Jul 25, 2016 · 42 revisions

HPE OneView 2.00 Library

Set-HPOVServerPower

Set the power state of a server.

SYNTAX

Set-HPOVServerPower [-Server] <Object> [-PowerState] <String> [-PowerControl] <String> [-ApplianceConnection] <Object>[ [-WhatIf] <SwitchParameter>][ [-Confirm] <SwitchParameter>] [<CommonParameters>]

Detailed Description

[Deprecated] Please note this Cmdlet is being deprecated for in favor of Start-HPOVServer, Stop-HPOVServer and Restart-HPOVServer Cmdlets. Please update your scripts accordingly.

Set the power state of the server using the virtual power button.

Parameters

-ApplianceConnection <Object>

Aliases [-Appliance]

Specify one HPOneView.Appliance.Connection object or Name property value. If Resource object is provided via Pipeline, the ApplianceConnection property of the object will be used.

Default Value: ${Global:ConnectSessions} | ? Default

[Object]$ApplianceConnection = (${Global:ConnectedSessions} | ? Default)

Aliases cf
Required? true
Position? named
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?    False

-Confirm <SwitchParameter>

Aliases cf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-PowerControl <String>

Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset

Current state powerState powerControl Result


On On MomentaryPress Exception: cannot achieve desired power state via the specified power control On On PressAndHold Exception: cannot achieve desired power state via the specified power control On On ColdBoot OK On On Reset OK On Off MomentaryPress OK (just have to assume that there?s an OS on the server and it will power off the server someday?) On Off PressAndHold OK On Off ColdBoot Exception: cannot achieve desired power state via the specified power control On Off Reset Exception: cannot achieve desired power state via the specified power control Off On MomentaryPress OK Off On PressAndHold Exception: cannot achieve desired power state via the specified power control Off On ColdBoot Exception: cannot achieve desired power state via the specified power control Off On Reset Exception: cannot achieve desired power state via the specified power control Off Off MomentaryPress Exception: cannot achieve desired power state via the specified power control Off Off PressAndHold Exception: cannot achieve desired power state via the specified power control Off Off ColdBoot Exception: cannot achieve desired power state via the specified power control Off Off Reset Exception: cannot achieve desired power state via the specified power control

Aliases cf
Required? true
Position? 2
Default value MomentaryPress
Accept pipeline input? false
Accept wildcard characters?    False

-PowerState <String>

Optional power state. Default is On, other option is Off

Aliases cf
Required? true
Position? 1
Default value On
Accept pipeline input? false
Accept wildcard characters?    False

-Server <Object>

Aliases [-name, -uri, -serverUri] The server object, URI or Name, or can be a Server Profile object.

Aliases cf
Required? true
Position? 0
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters?    False

-WhatIf <SwitchParameter>

Aliases cf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters?    False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

System.String Server Hardware Name

System.Management.Automation.PSCustomObject Server Hardware Resource

System.Management.Automation.PSCustomObject Server Profile Resource

Return Values

HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject] Async task that tracks the power state change

Examples

 -------------------------- EXAMPLE 1 --------------------------

PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower | Wait-HPOVTaskComplete

Power on the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.

 -------------------------- EXAMPLE 2 --------------------------

PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower -powerState off -powerControl PressAndHold

Power off the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.

 -------------------------- EXAMPLE 3 --------------------------

PS C:\> $task = Get-HPOVServerProfile "Profile1" -ApplianceConnection "MyAppliance.domain.com" | Set-HPOVServerPower -powerState On -powerControl MomentaryPress

Power on the specific server hardware by using the Server Profile object.

Related Links

HPE OneView 1.20 Library

Set-HPOVServerPower

Set the power state of a server.

SYNTAX

Set-HPOVServerPower [-server] <server>[ [-powerState] <powerState>][ [-powerControl] <powerControl>] [<CommonParameters>]

Detailed Description

Set the power state of the server using the virtual power button.

Parameters

-server <server>

Aliases [-name, -uri, -serverUri] The server object, URI or Name, or can be a Server Profile object.

Aliases
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters?    false

-powerState <powerState>

Optional power state. Default is On, other option is Off

Aliases
Required? false
Position? 2
Default value On
Accept pipeline input? false
Accept wildcard characters?    false

-powerControl <powerControl>

Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset

Current state powerState powerControl Result


On On MomentaryPress Exception: cannot achieve desired power state via the specified power control On On PressAndHold Exception: cannot achieve desired power state via the specified power control On On ColdBoot OK On On Reset OK On Off MomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) On Off PressAndHold OK On Off ColdBoot Exception: cannot achieve desired power state via the specified power control On Off Reset Exception: cannot achieve desired power state via the specified power control Off On MomentaryPress OK Off On PressAndHold Exception: cannot achieve desired power state via the specified power control Off On ColdBoot Exception: cannot achieve desired power state via the specified power control Off On Reset Exception: cannot achieve desired power state via the specified power control Off Off MomentaryPress Exception: cannot achieve desired power state via the specified power control Off Off PressAndHold Exception: cannot achieve desired power state via the specified power control Off Off ColdBoot Exception: cannot achieve desired power state via the specified power control Off Off Reset Exception: cannot achieve desired power state via the specified power control

Aliases
Required? false
Position? 3
Default value MomentaryPress
Accept pipeline input? false
Accept wildcard characters?    false

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

System.String Server Hardware Name System.Management.Automation.PSCustomObject Server Hardware Resource

Return Values

HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject] Async task that tracks the power state change

Examples

 -------------------------- EXAMPLE 1 --------------------------

PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower

Power on the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.

 -------------------------- EXAMPLE 2 --------------------------

PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower -powerState off -powerControl PressAndHold

Power off the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.

 -------------------------- EXAMPLE 3 --------------------------

PS C:\> $pro = Get-HPOVProfile "Profile1" PS C:\> Set-HPOVServerPower -serverUri $pro.configuration.assignedToServerUri -powerState On -powerControl MomentaryPress

Power on the specific server hardware by using the Server Profiles assignedToServerUri property.

Related Links

Wiki Table of Contents

Clone this wiki locally