Skip to content

Set HPOVServerPower

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

HP OneView 200 Library

NAME

Set-HPOVServerPower

SYNOPSIS

Set the power state of a server.

SYNTAX

 Set-HPOVServerPower [-server] <Object> [[-powerState] <String>] [[-powerControl] <String>] [-ApplianceConnection] <Object> [[-WhatIf] <SwitchParameter>] [[-Confirm] <SwitchParameter>]  [<CommonParameters>]

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

-server <Object>

Aliases [-name, -uri, -serverUri] 

The server object, URI or Name, or can be a Server Profile object.

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

-powerState [<String>]

Optional power state.  Default is On, other option is Off 
Aliases None
Required? false
Position? 2
Default value On
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


OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there?s an OS on the server and it will power off the server someday?) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset Exception: cannot achieve desired power state via the specified power control

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

-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 None
Required? true
Position? named
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters?    false

-WhatIf [<SwitchParameter>]

Aliases None
Required? false
Position? named
Default value <none>
Accept pipeline input? false
Accept wildcard characters?    false

-Confirm [<SwitchParameter>]

Aliases None
Required? false
Position? named
Default value <none>
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)

INPUTS

System.String

Server Hardware Name

_**System.Management.Automation.PSCustomObject**_

Server Hardware Resource

_**System.Management.Automation.PSCustomObject**_

Server Profile Resource

OUTPUTS

HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject]

Async task that tracks the power state change

#### RELATED LINKS

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.


HP OneView 120 Library

NAME

Set-HPOVServerPower

SYNOPSIS

Set the power state of a server.

SYNTAX

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

DESCRIPTION

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

PARAMETERS

-server <Object>

Aliases [-name, -uri, -serverUri] 

The server object, URI or Name, or can be a Server Profile object.

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

-powerState [<String>]

Optional power state.  Default is On, other option is Off 
Aliases None
Required? false
Position? 2
Default value On
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


OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset Exception: cannot achieve desired power state via the specified power control

Aliases None
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)

INPUTS

System.String

Server Hardware Name

_**System.Management.Automation.PSCustomObject**_

Server Hardware Resource

OUTPUTS

HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject]

Async task that tracks the power state change

#### RELATED LINKS

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.


HP OneView 110 Library

NAME

Set-HPOVServerPower

SYNOPSIS

Set the power state of a server.

SYNTAX

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

DESCRIPTION

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

PARAMETERS

-server <Object>

Aliases [-name, -uri, -serverUri] 

The server object, URI or Name, or can be a Server Profile object.

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

-powerState [<String>]

Optional power state.  Default is On, other option is Off 
Aliases None
Required? false
Position? 2
Default value On
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


OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset Exception: cannot achieve desired power state via the specified power control

Aliases None
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)

INPUTS

System.String

Server Hardware Name

_**System.Management.Automation.PSCustomObject**_

Server Hardware Resource

OUTPUTS

System.Management.Automation.PSCustomObject

Async task that tracks the power state change

#### RELATED LINKS

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.


Wiki Table of Contents

Clone this wiki locally