Automation

 View Only
  • 1.  Enable and set ESXi shell timeout

    Posted Feb 29, 2024 09:15 PM

    I am looking for a script for set the value of UserVars.ESXiShellTimeout on all our hosts to 3600.

    I am not great with scripts and have searched the internet. Now I am looking for help with it from the great minds here.

    Atif



  • 2.  RE: Enable and set ESXi shell timeout
    Best Answer

    Posted Feb 29, 2024 09:27 PM

    Try like this

    Get-VMHost | 
    Get-AdvancedSetting -Name "UserVars.ESXiShellTimeOut" | 
    Set-AdvancedSetting -Value "3600" -Confirm:$false

    Watch out with the spelling of the name, it is case sensitive 



  • 3.  RE: Enable and set ESXi shell timeout

    Posted Feb 29, 2024 09:30 PM

    My King!!! thank you.

    Would this do this for all ESXi hosts in a vCenter? If not, can we incorporate a spreadsheet with host names?



  • 4.  RE: Enable and set ESXi shell timeout

    Posted Feb 29, 2024 09:41 PM

    Yes, as you requested, this is for all ESXi nodes in your vCenter.

    If you want to read a set of names from a CSV for example, you do something like this.
    The CSV contains a column with the name EsxiName.

     

    $names = Import-Csv -Path .\esxinames.csv -UseCulture | 
        Select-Object -ExpandProperty EsxiName
    
    Get-VMHost -Name $names  | 
    Get-AdvancedSetting -Name "Uservars.ESXiShelltimeout" | 
    Set-AdvancedSetting -Value "900" -Confirm:$false

     

     



  • 5.  RE: Enable and set ESXi shell timeout

    Posted Mar 01, 2024 12:00 AM

    Completed 100 hosts in 3 minutes.

     

    Thank you LucD!!!