VMware Cloud Community
RobertoOrayen
Enthusiast
Enthusiast
Jump to solution

Change the root password of an ESXi Host

Hi,

I need help to get a VCO script that change the root password of an ESXi host.

In PowerCLI exists the Set-VMHostAccount cmdlet. I have been searching in VCO API... I haven't found it or something similar.

I have found the VcHostAccountSpec object but seems it only works with "Host Profiles" and my licenses are Standard and Enterprise.

http://www.vmware.com/support/orchestrator/doc/vco_vsphere51_api/html/VcHostAccountSpec.html 

Any idea?

Thanks, Roberto

1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Another option would be to connect to ESXi host using vCO SSH plug-in and execute 'passwd' command remotely. Haven't tried it but in theory it should work.

@Tim - we try to maintain compatibility of existing vCO plug-ins as much as possible so PowerShell plug-in should work with the latest vCO builds.

View solution in original post

4 Replies
schepp
Leadership
Leadership
Jump to solution

Hi Roberto,

telling from the link you posted I guess you run vSphere 5.1?

In 5.0 there was a vCO Plug-In for PowerShell which would enable you to run PowerShell ( and so PowerCLi ) scripts from vCO. I can't find the Plug-in in the download sections of vSphere 5.1 and 5.5 but maybe the old Plugin still works?!

Maybe running the PowerCLI script and using the Set-VMHostAccount cmdlet is an option for you?

Initial Blog-Post: vCO PowerShell plug-in | VMware vCenter Orchestrator Blog - VMware Blogs

Latest verion: VMware vCenter Orchestrator Plug-In for Microsoft Windows PowerShell 1.0.1 Release Notes

Download: https://my.vmware.com/group/vmware/details?downloadGroup=VCO_POWERSHELL_PLUGIN_101&productId=229

Tim

iiliev
VMware Employee
VMware Employee
Jump to solution

Another option would be to connect to ESXi host using vCO SSH plug-in and execute 'passwd' command remotely. Haven't tried it but in theory it should work.

@Tim - we try to maintain compatibility of existing vCO plug-ins as much as possible so PowerShell plug-in should work with the latest vCO builds.

RobertoOrayen
Enthusiast
Enthusiast
Jump to solution

Thanks for the answers.

The option of use the VCO PowerShell Plug-in is my last option, i prefer not install another virtual machine with Windows.

The vCO SSH plug-in seems a good option, i will test and share with yo.

Thanks.

0 Kudos
RobertoOrayen
Enthusiast
Enthusiast
Jump to solution

Hi Ilian,

It's works!

I enable the vCO SSH plugin and test a workflow with this steps:

  1. Start the SSH Server service
  2. Run a SSH command: "echo NewPassword | passwd --stdin root"
  3. Stop the SSH Server service

Thanks