Running CLI commands on target servers
In this recipe, we will learn how to issue commands on the added target vCenter Servers or ESXi hosts.
How to do it…
The following procedures explain how to set a target server and issue direct commands to it. We will discuss all three methods.
Method 1 – Issuing commands on the default target
Follow these steps to issue commands on the default target:
- Set the intended server as the default target for all commands:
Syntax: vifptarget –s <servername> Example: vifptarget –s esxi65ga-1.vcloud.local
- Issue the CLI commands, as you would at an ESXi host's console, as depicted here:
esxcli system version get

Method 2 – Issuing commands by specifying a target server
The following are the steps required to issue commands by specifying a target server:
- Issue the command specifying the server name:
Example:
esxcli --server esxi65ga-1.vcloud.local iscsi adapter list
- Supply the username and password when prompted to obtain results, as shown in the following console output...