VMwareHorizon Module | Vmware PowerCLI Reference

Getting Started with VMware Horizon cmdlets

Provides cmdlets for automating VMware Horizon features.

Step 1: Connect to Environment

To setup a connection you should use the Connect-HVServer command. Run the code sample below to connect.

# Connects to the Horizon API service that runs on an instance of a Horizon Connection server by using the User, Password, and Domain parameters.

Connect-HVServer -Server server -User username -Password pass -Domain domain

You can also connect to remote environment by running one of the alternative options to connect below:

Option 1 :

# Connects to the Horizon API service that runs on an instance of a Horizon Connection server with an existing session and returns the Horizon API service object. Username is alias to parameter user.

$cs = Connect-HVServer -Server server -Username user -Password pass -Domain domain; Connect-HVServer -Server server -SessionId $cs.SessionSecret

Option 2 :

# Connects to the Horizon API service of a Horizon Connection server by passing the domain as a part of the user name and returns the Horizon API service object.

Connect-HVServer -Server server -User username@domain -Password pass

Option 3 :

# Connects to the Horizon API service that runs on an instance of a Horizon Connection server. The user, domain, and password parameters are read by the PowerCLI user interface. Returns the Horizon API service object.

Connect-HVServer -Server server