< Back
Test-HPEOSPConnection
Post
NAME Test-HPEOSPConnection
SYNOPSIS
The Test-HPEOSPConnection cmdlet checks if the connection to the target is still valid.
SYNTAX
Test-HPEOSPConnection [-Connection] <Connection[]> [<CommonParameters>]
DESCRIPTION
The Test-HPEOSPConnection cmdlet checks whether the connection to the target is still valid. The result will be
stored in IsConnected output property. For a valid connection, IsConnected will be True; otherwise it will be
False. If an error occurs, the StatusInfo output property will hold the error category and message.
PARAMETERS
-Connection <Connection[]>
Connection object to iLO for OS Provisioning. This is a session object that identifies the target to which the
connection is established. The Connection object is created by the Connect-HPEOSP command using the
IP/Hostname and accompanying Username and Password to log into the iLO.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
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 (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
HPE.OSP.Connection[]
OUTPUTS
System.Management.Automation.PSObject[]
EXAMPLE 1
PS C:\\> $connection = Connect-HPEOSP -IP 10.20.30.1 -Username admin -Password admin123
PS C:\\> Test-HPEOSPConnection $connection
IP : 10.20.30.1
Hostname : abc1.domain.com
IsConnected : True
Status : OK
This example shows the output on a Gen10 server with connection object passed as positional input.
EXAMPLE 2
PS C:\\> $connection = Connect-HPEOSP -IP 10.20.30.1,10.20.30.2,10.20.30.3 -Username admin -Password admin123
PS C:\\> Test-HPEOSPConnection -Connection $connection
IP : 10.20.30.1
Hostname : abc1.domain.com
IsConnected : True
Status : OK
IP : 10.20.30.2
Hostname : abc2.domain.com
IsConnected : True
Status : OK
IP : 10.20.30.3
Hostname : abc3.domain.com
IsConnected : False
Status : Error
StatusInfo : @{Category=Connectivity; Message=Target server connection is disconnected.}
This example shows the output on the server with a list of connection objects passed as named parameter.
RELATED LINKS
http://www.hpe.com/servers/powershell
Connect-HPEOSP
Disconnect-HPEOSP
SYNOPSIS
The Test-HPEOSPConnection cmdlet checks if the connection to the target is still valid.
SYNTAX
Test-HPEOSPConnection [-Connection] <Connection[]> [<CommonParameters>]
DESCRIPTION
The Test-HPEOSPConnection cmdlet checks whether the connection to the target is still valid. The result will be
stored in IsConnected output property. For a valid connection, IsConnected will be True; otherwise it will be
False. If an error occurs, the StatusInfo output property will hold the error category and message.
PARAMETERS
-Connection <Connection[]>
Connection object to iLO for OS Provisioning. This is a session object that identifies the target to which the
connection is established. The Connection object is created by the Connect-HPEOSP command using the
IP/Hostname and accompanying Username and Password to log into the iLO.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
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 (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
HPE.OSP.Connection[]
OUTPUTS
System.Management.Automation.PSObject[]
EXAMPLE 1
PS C:\\> $connection = Connect-HPEOSP -IP 10.20.30.1 -Username admin -Password admin123
PS C:\\> Test-HPEOSPConnection $connection
IP : 10.20.30.1
Hostname : abc1.domain.com
IsConnected : True
Status : OK
This example shows the output on a Gen10 server with connection object passed as positional input.
EXAMPLE 2
PS C:\\> $connection = Connect-HPEOSP -IP 10.20.30.1,10.20.30.2,10.20.30.3 -Username admin -Password admin123
PS C:\\> Test-HPEOSPConnection -Connection $connection
IP : 10.20.30.1
Hostname : abc1.domain.com
IsConnected : True
Status : OK
IP : 10.20.30.2
Hostname : abc2.domain.com
IsConnected : True
Status : OK
IP : 10.20.30.3
Hostname : abc3.domain.com
IsConnected : False
Status : Error
StatusInfo : @{Category=Connectivity; Message=Target server connection is disconnected.}
This example shows the output on the server with a list of connection objects passed as named parameter.
RELATED LINKS
http://www.hpe.com/servers/powershell
Connect-HPEOSP
Disconnect-HPEOSP