Overview of Running Commands
You can run vCLI commands interactively or in scripts in several ways.
When you run commands against an ESXi host, you must be authenticated for that host. When you run commands against a vCenter Server system, and you are authenticated for that system, you can target all ESXi hosts that vCenter Server manages without additional authentication. See Specifying Authentication Information.
Caution If you specify passwords in plain text, you risk exposing the password to other users. The password might also become exposed in backup files. Do not provide plain-text passwords on production systems.
Follow one of the following approaches for protecting passwords.
For noninteractive use, you can create a session file using the save_session script included in the apps/session directory. See Using a Session File.
If you are running on a Windows system, you can use the --passthroughauth option. If the user who runs the command with that option is known, no password is required.
If you are running vMA, you can set up target servers and run most vCLI commands against target servers without additional authentication. See the vSphere Management Assistant Guide.