PowerCLI Reference

Connect-CIServer

Synopsis

This cmdlet establishes a connection to the specified servers.

Syntax

Connect-CIServer [-Server] <String[]> [-Org <String>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Port <Int32>] [-NotDefault] [-SaveCredentials] [-WhatIf] [-Confirm] [<CommonParameters>]

Connect-CIServer [-Server] <String[]> [-SessionId] <String> [-Port <Int32>] [-NotDefault] [-WhatIf] [-Confirm] [<CommonParameters>]

Connect-CIServer [-NotDefault] [-PIDatacenter] <CIServerRelatedObject> [-WhatIf] [-Confirm] [<CommonParameters>]

Connect-CIServer -Menu [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Disconnect-CIServer

Detailed Description

This cmdlet establishes a connection to the specified cloud servers. The cmdlet starts a new session or re-establishes a previous session with a cloud server using the specified parameters. If a connection to a server already exists, the cmdlet returns an object which represents the existing connection.

When you attempt to connect to a server, the server checks for valid certificates. To set the default behavior of PowerCLI when no valid certificates are recognized, use the InvalidCertificateAction parameter of the Set-PowerCLIConfiguration cmdlet. For more information about invalid certificates, run 'Get-Help about_invalid_certificates'.

PowerCLI for vCloud supports a list of default servers. If the target servers cannot be determined from the specified parameters, the cmdlet runs against the servers in the default server list. All default servers are kept in a global array variable called $DefaultCIServers. When you connect to a server, the server is added at the beginning of the array, unless the NotDefault parameter is specified. When you disconnect from a server, the server is removed from the $DefaultCIServers variable. You can modify the value of the $DefaultCIServers variable manually.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerString[]Specifies the IP or DNS addresses of the cloud servers you want to connect to.truefalse
PIDatacenterCIServerRelatedObjectSpecifies a vCloud Air datacenter, which can be retrieved by using the Get-PIDatacenter cmdlet or PIComputeInstance, which can be retrieved by using the Get-PIComputeInstance cmdlet.truetrue (ByValue)
SessionIdStringSpecifies the ID of an existing cloud server session you want to reestablish.truefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
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
MenuSwitchParameterIndicates that you want to select a 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.falsefalse
OrgStringSpecifies the name of the organization you want to manage. By default, it is the System organization to which you must connect to. The value of the Org parameter overrides the domain part of the value provided to the User parameter.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
PortInt32Specifies the port on the server you want to use for the connection.falsefalse
SaveCredentialsSwitchParameterIndicates that you want to save the specified credentials in the local credential store.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
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

One or more CIServer objects

Notes

Examples

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

Connect-CIServer -Server cloud.example.com -User Org1Admin -Password pass -Org Organization1

Connects as an organization user to the provided organization.

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

Connect-CIServer -Server cloud.example.com -User admin -Password pass

Connects as a system administrator to a system organization.

-------------- Example 3 --------------

Connect-CIServer -Server cloud.example.com -Org Organization1 -Credential $vappUserCredential

Connects to the provided organization by specifying a credential object.

-------------- Example 4 --------------

Connect-CIServer -Server cloud.example.com -SessionID $sessionID

Connects to a server by providing a server session ID.

-------------- Example 5 --------------

Connect-CIServer -Menu

Connects to a server from the list of recently connected servers.

-------------- Example 6 --------------

$vCloudAirConnection = Connect-PIServer -User myUser@vmware.com -Password 'pass'
$myDatacenter = Get-PIDatacenter 'myDatacenter'
Connect-CIServer -PIDatacenter $myDatacenter

Connects to a vCloud Air datacenter.


Copyright © VMware, Inc. All rights reserved.