You can pass in command-line options by using option name and option value pairs in most cases.

For ESXCLI commands, you can use long or short options. An equal sign between option name and option value is optional.

esxcli --server <vc_HOSTNAME_OR_IP> --username <privileged_user> --password <pw> --vihost <esxi_HOSTNAME_OR_IP> <namespace> [<namespace]...> <command> --<option_name=option_value>

For other vCLI commands, use long or short options. An equal sign is not supported.

<vicfg- command> --server <vc_HOSTNAME_OR_IP> --username <privileged_user> --password <pw> --vihost <esxi_HOSTNAME_OR_IP> --<option_name option_value>

Some options, such as --help, have no value.

Important

Enclose passwords and other text with special characters in quotation marks.

When running commands on Windows, use double quotes (" "). When running commands on Linux, use single quotes (' ') or a backslash (\) as an escape character.

The following examples connect to the server as user snow-white with password dwarf$.

esxcli --server <esxi_HOSTNAME_OR_IP> --username snow\-white --password dwarf\$ network ip interface list
esxcli --server <esxi_HOSTNAME_OR_IP> --username snow\-white --password 'dwarf$' network ip interface list
vicfg-mpath --server <esxi_HOSTNAME_OR_IP> --username snow\-white --password dwarf\$ --list
vicfg-mpath --server <esxi_HOSTNAME_OR_IP> --username 'snow-white' --password 'dwarf$' --list
esxcli --server <esxi_HOSTNAME_OR_IP> --username "snow-white" --password "dwarf$" network ip interface list
vicfg-mpath.pl --server <esxo_HOSTNAME_OR_IP> --username “snow-white” --password “dwarf$” --list