Syntax
Connect-VIServer [-Server] <String[]> [-Port <Int32>] [-Protocol <String>] [-Credential <PSCredential>] [-User <String>] [-Password <String>] [-Session <String>] [-NotDefault] [<CommonParameters>]Related Commands
Disconnect-VIServerDetailed Description
Connects to a vSphere server. The cmdlet starts a new session or re-establishes a previous session with a vSphere server using the specified parameters.Parameters
Input Type
Return Type
VMware.VimAutomation.Types.VIServerNotes
Examples
-------------- EXAMPLE 1 -------------- C:\PS>Connect-VIServer -Server 10.23.112.235 -Protocol https -User Administrator -Password pass01 Connects to a vSphere server using the User and Password parameters. Name Port ---- ---- 10.23.112.235 443 -------------- EXAMPLE 2 -------------- C:\PS>$srv = Connect-VIServer 10.23.115.133 -User Admin -Password Pass01 Connect-VIServer 10.23.115.133 -Session $srv.SessionId Connects to a vSphere server and restores a previous session. Note that when res toring a session, user does not need to specify credentials for authenticating w ith the server. Name Port ---- ---- 10.23.112.236 442