Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Installation tool VMware vSphere PowerCLI connection exsi to control virtual machine switch

Shulou Source: shulou.com Published: 2022-06-01 08:43:42 10月03日 Update

Installation tool VMware vSphere PowerCLI connection exsi control virtual machine switch!

Run VMware vSphere PowerCLI as an administrator, but PowerShell disables script execution by default, as shown in the following figure.

You can run the set-executionpolicy Unrestricted command to change the current rule to an unrestricted type (any script downloaded from the outside can be run, but with a warning before running).

Then exit and run as an administrator again.

4. After connecting to the server with the connect-viserver command, you can run the PowerCLI command or script.

The syntax of the connect-viserver command:

Connect-VIServer [[- Server]] [- Port] [- Protocol] [- Credential] [- User] [- Password] [- Session] [- NotDefault] [- SaveCredentials] []

Connect-VIServer-Menu []

Specific information can be obtained by running the get-help connect-viserver command.

For example:

① connect-viserver-server 192.168.163.135-user root-password Admin900

② connect-viserver-server 192.168.163.135

PS C:\ Program Files (x86)\ VMware\ Infrastructure\ vSphere PowerCLI > get-vm

Name PowerState Num CPUs MemoryGB

-

Win2003-ERP PoweredOn 2 1.500

Centos-1 PoweredOff 1 1.000

Centos-SMB PoweredOn 2 1.000

Nas PoweredOff 2 0.391

Win2008-DC PoweredOn 1 1.000

CactiEZ10 PoweredOff 1 0.535

Freenas1 PoweredOn 1 1.000

Panabit PoweredOn 1 0.500

Enable the virtual machine: Start-vm nas

Tags: Runs commands scripts methods administrators administration tools controls information but servers types rules syntax services Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Shulou Technology OPPO Reno Docker