PowerCLI Reference

Connect-Vmc

Synopsis

This cmdlet establishes a connection to a VMware Cloud on AWS server.

Syntax

Connect-Vmc -Menu [<CommonParameters>]

Connect-Vmc [-NotDefault] [-RefreshToken <SecureString>] [-SaveRefreshToken] [<CommonParameters>]

Related Commands

Online Version
Disconnect-Vmc

Detailed Description

This cmdlet establishes a connection to a VMware Cloud on AWS server. Only Open Authorization (OAuth) is supported and a refresh token retrieves an access token, which later makes calls to the server.


When running, the cmdlet performs the following steps: 1. If the Menu parameter is specified, a list of the latest connected VMware Cloud on AWS servers appears. 2. If neither the Menu nor server is specified, the default "vmc.vmware.com" value is used (the only available VMware Cloud on AWS server). 3. If the RefreshToken parameter is not specified, the local credential store is searched for a previously saved one. If a refresh token is not found, an error report is displayed. 4. When using the Server and RefreshToken parameters, a new access token is requested and is later used for communication with the server. The access token is regularly renewed by using the refresh token while the PowerShell process is running or the server connection is closed with the Disconnect-Vmc cmdlet.


Note: If PowerShell runs in non-interactive mode, you are not prompted for credentials. If the server certificate needs approval and it is not permanently accepted, it is automatically rejected and the cmdlet stops running.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
MenuSwitchParameterIndicates that you want to select a connection server from a list of recently connected servers. If Menu is set to $true, the cmdlet retrieves a list of the last visited servers and enters a nested command prompt, so that you can select a server from the list.trueFalse
NotDefaultSwitchParameterSpecifies that you do not want to save the specified servers as default servers (the $global:defaultVmcServers PowerShell variable).falseFalse
RefreshTokenSecureStringSpecifies the OAuth refresh token you want to use for authentication with the VMware Cloud on AWS server. The token is obtained from the VMware Cloud on AWS server's Web UI portal.falseFalse
SaveRefreshTokenSwitchParameterIndicates that the refresh token that you use for establishing the server session is saved to a local credential store and can be used automatically when connecting again to the same server.falseFalse

Return Type

VMware.VimAutomation.Vmc.Types.V1.VmcServer

Notes

Examples

-------------------------- Example 1 --------------------------

Connect-Vmc -RefreshToken $myRefreshToken

Connects to a VMware Cloud on AWS server.

-------------------------- Example 2 --------------------------

Connect-Vmc -RefreshToken $script:refreshToken -SaveRefreshToken

Connects to a VMware Cloud on AWS server by specifying the related secure connection token and saving it for later usage.


Copyright © VMware, Inc. All rights reserved.