DefinIT

  • VMware
    • NSX
    • vRealize Automation
    • vRealize Orchestrator
    • vSphere
    • vSAN
    • vRealize Operations
    • Log Insight
    • PowerCLI
  • Community
    • VMworld
    • Opinion
    • Webinar
    • Career
  • Storage
    • vSAN
  • Networking
    • NSX
  • Authors
    • Simon’s Lab
    • Sam’s Lab
  • GitHub

Changing ESXi root passwords the smart way (via PowerCLI)

04/06/2013 by Sam 3 Comments

PowerCLI LogoIf you work in company with strict password compliance rules, for example under SOX, you might well have to change administrator passwords every month. Doing this on any more than a few hosts is tedious work – even on two hosts it seems like a waste of time logging on the host via SSH (or even enabling it first) before changing the password. Then we also need to audit the change, there’s no point making it for compliance reasons if we can’t then prove we did it!

Changing ESXi passwords the manual way

Steps taken from VM KB 1004659

  1. Log on to SSH as root, or log on and use “su –“ to get root level access
  2. Use “passwd root” to change the root password
  3. Log off and log back on using the new password to test access

Rinse and repeat

Changing ESXi root passwords the smart way (via PowerCLI)

The script is fairly heavily commented, usage is as follows:

.\Change-HostPasswords.ps1 -vCenter VC-01.definit.local -Location “DefinIT Lab”

Source code for this has moved to GitHub to allow a bit more structured collaboration:

https://github.com/sammcgeown/Change-HostPasswords/blob/master/Change-HostPasswords.ps1

Filed Under: VMware Tagged With: ESX and ESXi, PowerCLI, Security

Trackbacks

  1. PowerCLI - Update ESXi Root Password with Password Generator says:
    07/04/2014 at 7:03 pm

    […] # http://www.lucd.info/2012/01/15/change-theroot-password-in-hosts-and-host-profiles/ # https://www.definit.co.uk/2013/06/changing-esxi-root-passwords-the-smart-way-via-powercli/ # Thank you to The ScriptingGuys, Luc Dekens, Sam McGeown # Create password generator # Create […]

    Reply
  2. Gestión de claves de hosts vmware en esxi 6 – tecnocracia .es says:
    17/12/2015 at 6:33 pm

    […] https://www.definit.co.uk/2013/06/changing-esxi-root-passwords-the-smart-way-via-powercli/ […]

    Reply
  3. PowerCLI – Update ESXi Root Password with Password Generator - Blurt - This says:
    14/08/2017 at 2:58 pm

    […] # http://www.lucd.info/2012/01/15/change-theroot-password-in-hosts-and-host-profiles/ # http://www.definit.co.uk/2013/06/changing-esxi-root-passwords-the-smart-way-via-powercli/ # Thank you to The ScriptingGuys, Luc Dekens, Sam McGeown # Create password generator # Create […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sponsors

VMTurbo - Why pay for monitoring? Vembu - Backup unlimited VMs, free, forever!

Tags

3rd Party Software Active Directory appliance Automation blogengine certificates Certificate Services ESX and ESXi esxi Exchange Exchange Exchange 2010 Hardware lab Networking nsx nsx-t NSX/vCNS opsmgr PowerCLI PowerShell PowerShell Security System Center vcac vCenter Server vco vmug VMUG VMWare vmworld vRA vRealize Automation vRealize Orchestrator vro vrops VSAN vsphere Webinar webinar What's new Windows Windows Server 2003 Windows Server 2008 Windows Vista
Creative Commons Licence
This work is licensed under a Creative Commons Attribution 4.0 International License.

Copyright © 2018 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in