PowerCLI Reference

Connect-PIServer

Synopsis

This cmdlet establishes a connection to a vCloud Air server.

Syntax

Connect-PIServer [-Server <String[]>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-NotDefault] [-SaveCredentials] [-VCA] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Related Commands

Online version
Disconnect-PIServer

Detailed Description

This cmdlet establishes a connection to the default vCloud Air server (vchs.vmware.com or vca.vmware.com) or the server specified by the -Server parameter.

The connect and disconnect operations for a server are using a reference counting mechanism. Every server is identified by its connection string which contains server and user name. If there is already an existing connection to the server for a specific user name, a new connection is not established. Instead, the cmdlet returns the object which represents the existing connection. The RefCount property of the object is incremented by one. Note that the returned object is the same as the one previously returned. Therefore, the RefCount of the previously returned object will be updated as well. When a server is disconnected, then its RefCount property is decreased by one. If this number becomes equal to zero, then the server is disconnected.

PowerCLI for vCloud Air supports a list of default servers. When an operation is performed, if the target servers cannot be determined from the specified parameters, the cmdlet runs against the servers in the default server list. They are kept in a global variable called $DefaultPIServers. It is of an array type and its initial value is an empty array. When you connect to a server, the server is added at the beginning of the array, unless -NotDefault parameter is specified. When you disconnect from a server, the server is removed from the $DefaultPIServers variable. When all servers are removed from the variable its value is an empty array. You can modify the value of the $DefaultPIServers variable manually.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
CredentialPSCredentialSpecifies a PSCredential object that contains credentials for authenticating with the server. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".falsefalse
InformationActionActionPreferencefalsefalse
InformationVariableStringfalsefalse
NotDefaultSwitchParameterSpecifies that you do not want to save the specified servers as default servers.falsefalse
PasswordStringSpecifies the password you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".

Note: If the password contains special characters, enclose the entire string in single quotes (').
falsefalse
PipelineVariableStringfalsefalse
SaveCredentialsSwitchParameterIndicates that you want to save the specified credentials in the local credential store.falsefalse
ServerString[]Specifies the IP or DNS addresses of the vCloud Air servers you want to connect to. If not specified, the default server address is used.falsefalse
UserStringSpecifies the user name you want to use for authenticating with the server. If the Credential parameter is also specified, this parameter is ignored. For more information about the server authentication logic of PowerCLI, run "help about_server_authentication".

Note: If the user name contains special characters, enclose the entire string in single quotes (').
falsefalse
VCASwitchParameterIf specified, a connection to the vCloud Air platform (vca.vmware.com) is established. If not specified, a connection to the vCloud Hybrid Service platform (vchs.vmware.com) is established.falsefalse

Return Type

VMware.VimAutomation.PCloud.Types.V1.PIServer

Notes

Examples

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

Connect-PIServer -User 'user@mail.com' -Password 'user_password'

Connects to the vCloud Hybrid Service (vCHS) platform by providing a user name and password.

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

Connect-PIServer -VCA -User 'user@mail.com' -Password 'user_password'

Connects to the vCloud Air platform by providing a user name and password.


Copyright © VMware, Inc. All rights reserved.