I am trying to use Set-VMHostAuthentication to join and ESXi host to AD. According to the documentation, the user and password switches are optional. When i try to run the command without these switches, I am still prompted to enter credentials. Am i missing something? I want the command to run under the credentials of the user executing the script.
Are you using this documentation: https://developer.vmware.com/docs/powercli/latest/vmware.vimautomation.core/commands/set-vmhostauthe...
yes, and that shows that those parameters are optional.
I agree. I see the same. Are you running the script as a certain user or just the logged on user?
Logged in user. But that user has rights to connect to vCenter and join objects to the domain.