How to set ESXi Shell timeout session value Using Powershell or PowerCLI – VirtuallyThatGuy

Another quick blog post about changing and updating esxi shell session timeout using powercli.

ESXi Shell session timeout

 

# Set ESXi shell session time-out to 10 minutes (600 seconds)

 

#List UserVars.ESXiShellInteractiveTimeOut for each host

Get-VMHost​​ *​​ |​​ Select​​ Name,​​ @{N=”UserVars.ESXiShellInteractiveTimeOut”;E={$_|​​ Get-AdvancedSetting​​ -Name​​ UserVars.ESXiShellInteractiveTimeOut​​ |​​ Select​​ -ExpandProperty​​ Value}}​​ |​​ Sort-Object​​ name​​ |​​ ft​​ -a ​​​​ 

 

 

 

 

 

# Set UserVars.ESXiShellTimeOut to 600 on all hosts

Get-VMHost​​ *​​ |​​ Foreach​​ {​​ Get-AdvancedSetting​​ -Entity​​ $_​​ -Name​​ UserVars.ESXiShellInteractiveTimeOut​​ |​​ Set-AdvancedSetting​​ -Value​​ 600 ​​​​ -Confirm:$false​​ }|​​ Sort-Object​​ name​​ |​​ ft​​ -a ​​​​ 

​​ 

 

 

 

# Set ESXi shell session time-out to 10 minutes (600 seconds)

#List UserVars.ESXiShellInteractiveTimeOut for each host
Get-VMHost * | Select Name, @{N=”UserVars.ESXiShellInteractiveTimeOut”;E={$_| Get-AdvancedSetting -Name UserVars.ESXiShellInteractiveTimeOut | Select -ExpandProperty Value}} | Sort-Object name | ft -a  

# Set UserVars.ESXiShellTimeOut to 600 on all hosts
Get-VMHost * | Foreach { Get-AdvancedSetting -Entity $_ -Name UserVars.ESXiShellInteractiveTimeOut | Set-AdvancedSetting -Value 600  -Confirm:$false }| Sort-Object name | ft -a  
 

You May Also Like

About the Author: VirtuallyThatGuy

1 Comment

  1. It doesn’t work. Getting this error.

    PS C:\Users\a-jaime.lasalle> Get-VMHost​​ *​​ |​​ Select​​ Name,​​ @{N=”UserVars.ESXiShellInteractiveTimeOut”;E={$_|​​ Get-AdvancedSetting​​ -Name​​ UserVars.ESXiShellInteractiveTimeOut​​ |​​ Select​​ -ExpandProperty​​ Value}}​​ |​​ Sort-Object​​ name​​ |​​ ft​​ -a ​​​
    Get-VMHost​​ : The term ‘Get-VMHost​​’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
    verify that the path is correct and try again.
    At line:1 char:1
    + Get-VMHost​​ *​​ |​​ Select​​ Name,​​ @{N=”UserVars.ESXiShellInteract …
    + ~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Get-VMHost​​:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Leave a Reply

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