top of page
  • Facebook
  • Twitter
  • Linkedin

PowerShell Scripts to Manage ESXi Host Configuration Settings "UserVars.ESXiShellTimeOut"

Jan 26

2 min read

0

169

0

In environments with many ESXi hosts, managing hosts with scripts is faster and less error prone than managing the hosts from the vSphere Client.


VMware PowerCLI is a Windows PowerShell interface to the vSphere API, and includes PowerShell cmdlets for administering vSphere components. ESXCLI includes a set of commands for managing ESXi hosts and virtual machines.



Situation:


While ESXi host hypervisor & firmware upgrade, there was a requirement for all ESXi host's advance setting "UserVars.ESXiShellTimeOut" to be updated from "0" to "600" seconds to prevent timeout while upgrade. If you have few hosts then it is an easy job, however with a big environment better to automate to save time and prevent from any human error.


Procedure:


  1. Connect to vCenter using PowerShell.


    # Connect-VIServer -Server "vCenterName"



  2. Perform validation once to verify current configured value for all ESXi hosts.


    # Get-VMHost | Select Name, @{N="UserVars.ESXiShellTimeOut";E={$_ | Get-AdvancedSetting -Name UserVars.ESXiShellTimeOut | Select -ExpandProperty Value}} | Sort-Object name | Format-Table -AutoSize



  3. Now, use & run the below command to chang the "UserVars.ESXiShellTimeOut" value of all the ESXi host in vCenter from 0 to 600 or as per your requirement.


    Note - This CLI will perform this change for all the ESXi host existing in vCenter. If you need to run for specific cluster in your vCenter then update the command before you run it. Or if you need any help with specific requirement, drop a message on this post.


    # Get-VMHost | Foreach {Get-AdvancedSetting -Entity $_ -Name UserVars.ESXiShellTimeOut | Set-AdvancedSetting -Value 600 -Confirm:$false}



  4. Post change, perform validation. We can see in below screenshot, it changed and updated the value from 0 to 600.



Conclusion:

By following these steps, you can effectively update the Advance setting value "UserVars.ESXiShellTimeOut " for all the ESXi in vCenter.


!Best of luck!






Jan 26

2 min read

0

169

0

Comments

Share Your ThoughtsBe the first to write a comment.

Contact Us

Thanks for submitting!

 Address. 500 Terry Francine Street, San Francine, CA 94158

Tel. 123-456-7890

© 2035 by ITG. Powered and secured by Wix

bottom of page