Skip to main content
SnapCenter 5.0 cmdlets

Open-SmConnection

Contributors

Initiates a PowerShell connection session with SnapCenter, for a specified user.

Syntax

Open-SmConnection [-Credential]  <PSCredential>  [-SMSbaseUrl]  <String>  [-Port]  <String>  [-RoleName]  <String>  [-AccessToken ]  <String>

Detailed Description

Initiates a PowerShell connection sessionwith SnapCenter, for a specified user. The session is valid for 24 hours. To end a PowerShell connection session, exit PowerShell by either entering the Exit command at the PowerShell prompt, or by closing the PowerShell window.You can open separate PowerShell sessions to the same SnapCenter Server by using different user credentials for each session.

Parameters

Name Description Required? Pipeline Input Default Value

Credential

Provides domain user credentials for the user for whom you wish to establish a PowerShell session.

true

true (ByPropertyName)

SMSbaseUrl

Specifies the SnapCenter Server base URL. The base URL includes the name or IP address of the SnapCenter Server, and, if the remote system is in a different domain from that of the SnapCenter Server, the domain name.For example: https://SNAPCENTER_SERVER_NAME/DOMAIN_NAME.

false

true (ByPropertyName)

Port

Enables you to specify the port number when the port is different than the default of 8146.

false

true (ByPropertyName)

RoleName

If a user is assigned to multiple roles, specifies the role with which you want to log in.

false

true (ByPropertyName)

AccessToken

Provides AccessToken parameter value from ADFS for MFA login in PowerShell.

false

true (ByPropertyName)

Examples

Example 1: Opening a PowerShell session

 Open-SmConnection

This command syntax opens a PowerShell session.

Example 2: Opening a PowerShell session with a specific role

 Open-SmConnection -Credential sddev\administrator

This command syntax opens a PowerShell session for the specified role.

.

Example 3: Opening a PowerShell session to SnapCenter Server from a remote host using the SnapCenter Server name and domain in the base URL

 Open-SmConnection –SMSbaseUrl https://SnapCenterServer1 -RoleName "SnapCenterAdmin"

This example syntax opens a PowerShell session to SnapCenter from a remote host in a different domain using the SnapCenter Server name in the base URL and the specified role.

Example 4: Opening a PowerShell session from a remote host to SnapCenter using the SnapCenter Server IP address in the base URL

 Open-SmConnection -SMSbaseUrl https://172.17.166.128:8146 -RoleName SnapCenterAdmin -Verbose

This example syntax opens a PowerShell session to SnapCenter from a remote host using the SnapCenter Server IP address in the base URL.

Example 5: Opening a PowerShell session using a port that is not the default

 Open-SmConnection -Port 1694

This example syntax opens a PowerShell connection using a port that is different from the default port, 8146.

Example 6: Opening a PowerShell session from a remote host to SnapCenter using a base URL and a port that is not the default

 Open-SmConnection -SMSbaseUrl https://SnapCenterServer1.netapp.com:8156

This examples syntax opens a PowerShell session to SnapCenter from a remote host using a base URL and a port that is not the default port, 8146.

Example 7: Opening a PowerShell session with AccessToken

 Open-SmConnection -AccessToken eyJ0eXAiOiJKV0QiLcJhBGciOiJSUzI0NiIsIng0dcI0Ik0UBnZGTTNzm00dAjNFOF0ZmFY0cVI0BdFqRSIsImtpZcI0Ik0UBnZGTTNzm00dAjNFOF0ZmFY0cVI0BdFqRSJ0.eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJBdWQiOiJBdWQiLCJTY29wZSI6IlRlc3QiLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IlRlc3QiLCJUZXN0IjoiVGVzdCIsImV4cCI6MTY4Mzg5MDg1MywiaWF0IjoxNjgzODkwODUzfQeyJSb2xlIjoiQWRtaW4iLCJBdWQiOiJBdWQiLCJTY29wZSI6IlRlc3QiLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IlRlc3QiLCJUZXN0IjoiVGVzdCIsImV4cCI6MTY4Mzg5MDg1MywiaWF0IjoxNjgzODkwODUzfQeyJSb2xlIjoiQWRtaW4iLCJBdWQiOiJBdWQiLCJTY29wZSI6IlRlc3QiLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IlRlc3QiLCJUZXN0IjoiVGVzdCIsImV4cCI6MTY4Mzg5MDg1MywiaWF0IjoxNjgzODkwODUzfQeyJSb2xlIjoiQWRtaW400.h0ap0OmGcF_oacv00WZLT0umtt0v0N_dfyxym0Q0rjzB0hLudLgzRXAjmEzAXT-0wVfllnqfT0PBN0r0EXR0sWK0P00nA0QZ-m00o00uU_dcZJ0XmnOh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