Connect-Unisphere
SYNOPSIS
Connects to a Unisphere server, optionally saves credentials for reuse. This command needs to be executed prior to any other PowerMax commands in a PowerShell session. When running the command, save the output to a variable, e.g., “$unisphere = Connect-Unisphere …”, so that the variable can be used as an input of other commands. Use Get-PowerMaxArray command to get the arrays that are managed by the Unisphere server.
SYNTAX
ByCredential (Default)
Connect-Unisphere [-HostName] <String> [-Port <Int32>] -Credential <PSCredential> [-HttpTimeout <Int32>] [-IgnoreCertErrors]
[-SaveCredentials] [<CommonParameters>]
ByUser
Connect-Unisphere [-HostName] <String> [-Port <Int32>] -User <String> -Password <String> [-HttpTimeout <Int32>] [-IgnoreCertErrors]
[-SaveCredentials] [<CommonParameters>]
BySaved
Connect-Unisphere [-HostName] <String> -UseSaved [<CommonParameters>]
DESCRIPTION
Connects to a Unisphere server and returns the connected UnisphereServer instance. The UnisphereServer instance can be used in subsequent commands.
Use Disconnect-Unisphere to disconnect from the Unisphere server. The connection will be automatically disconnected when the PowerShell session ends.
If the connection information needs to be updated, disconnect the Unisphere server first, then run this command with new information.
Port and HttpTimeout are optional. If not provided, Port 8443 and HttpTimeout 300 seconds will be used, unless the UseSaved option is used.
With the SaveCredentials option, encrypted credentials and connection information will be persisted across PowerShell sessions. The saved credentials and connection information can be deleted using the Disconnect-Unisphere command with DeleteCredentials option.
With the UseSaved option, the credentials and the connection information of the Unisphere server (saved previously using the SaveCredentials option from the same session or a different session) will be used.
Only TLS 1.2 protocol is supported. Certificates need to be imported to the Trusted Root Certification Authorities prior to running the command. To bypass TLS certificate errors you can use the -IgnoreCertErrors option.
EXAMPLES
Example 1
PS C:\> $unisphere = Connect-Unisphere -HostName host
Connects to a Unisphere server by creating a credential interactively and using the default port 8443, HTTP timeout 300 seconds, and saves the returned instance to variable $unisphere.
Example 2
PS C:\> $unisphere = Connect-Unisphere -HostName host -User user -Password password
Connects to a Unisphere server with user, password, the default port 8443, HTTP timeout 300 seconds, and saves the returned instance to variable $unisphere.
Example 3
PS C:\> $unisphere = Connect-Unisphere -HostName host -Port 8443 -User user -Password password -HttpTimeout 180 -SaveCredentials
Connects to a Unisphere server with Port 8443, HTTP timeout 180 seconds, and saves the credentials and the connection information for reuse. The returned instance is saved to variable $unisphere.
Example 4
PS C:\> $unisphere = Connect-Unisphere -HostName host -UseSaved
Connects to a Unisphere server using previously saved credentials and connection information, and saves the returned instance to variable $unisphere.
PARAMETERS
-HostName
FQDN or IP address.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Port
Port number (default value 8443).
Type: Int32
Parameter Sets: ByCredential, ByUser
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Credential
A PSCredential instance.
Type: PSCredential
Parameter Sets: ByCredential
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-User
User.
Type: String
Parameter Sets: ByUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Password
Password.
Type: String
Parameter Sets: ByUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-HttpTimeout
Time to wait in seconds for REST server to respond (default value 300).
Type: Int32
Parameter Sets: ByCredential, ByUser
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SaveCredentials
Saves credentials and connection information to a file for future reuse.
Type: SwitchParameter
Parameter Sets: ByCredential, ByUser
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UseSaved
Uses saved credentials and connection information.
Type: SwitchParameter
Parameter Sets: BySaved
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IgnoreCertErrors
Ignore TLS/SSL certificate errors.
Type: SwitchParameter
Parameter Sets: ByCredential, ByUser
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.