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.
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.