## 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] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Connect-CIServer [-Server] <String[]> [-SessionId] <String> [-Port <Int32>] [-NotDefault] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Connect-CIServer [-NotDefault] [-PIDatacenter] <CIServerRelatedObject> [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Connect-CIServer -Menu [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-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

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Server | String[] | Specifies the IP or DNS addresses of the cloud servers you want to connect to. | true | false
PIDatacenter | CIServerRelatedObject | Specifies 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.? | true | true (ByValue)
SessionId | String | Specifies the ID of an existing cloud server session you want to reestablish. | true | false
Confirm | SwitchParameter | If 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. | false | false
Credential | PSCredential | Specifies 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". | false | false
InformationAction | ActionPreference |  | false | false
InformationVariable | String |  | false | false
Menu | SwitchParameter | Indicates 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. | true | false
NotDefault | SwitchParameter | Specifies that you do not want to save the specified servers as default servers. | false | false
Org | String | Specifies 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. | false | false
Password | String | Specifies 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 ('). | false | false
PipelineVariable | String |  | false | false
Port | Int32 | Specifies the port on the server you want to use for the connection. | false | false
SaveCredentials | SwitchParameter | Indicates that you want to save the specified credentials in the local credential store. | false | false
User | String | Specifies 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 ('). | false | false
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

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.