Please enable Javascript for better experience...
Setting DCUI, SSH & ESXi Shell Timeout Value for Security reason
By Jitendra | Jul 12, 2022 | In Articles | Total Views [ 274 ]
(0 Like)
Rate

intial description

Setting  DCUI, SSH & ESXi Shell Timeout Value for Security reason

This is very simple script which will export the data in csv as well as set the value also.

See the sample output below

body

VC Host Version ESXiShell_Timeout SSH_Timeout Dcui_TimeOut
vmwarediary abc1.vmwarediary.com 6.7.0 300 300 300
vmwarediary abc2.vmwarediary.com 6.7.0 300 300 300
vmwarediary abc3.vmwarediary.com 6.7.0 300 300 300
vmwarediary abc4.vmwarediary.com 6.7.0 300 300 300

Some notes to keep in mind while using script and use it very carefully at your own consent.

1. Script have two section inside. First Get the value and export in csv and other one set the value and export in csv.

2. You must have powercli module installed on the server.

3. Use the parameter as per your infra decided value.

import-module vmware.vimautomation.core
Connect-VIServer vmwarediary
$HostData = @()
$vmhs = Get-VMHost

foreach($vmh in $vmhs){
$myItem = "" | Select VC , Host , Version, ESXiShell_Timeout , SSH_Timeout , Dcui_TimeOut
$myItem.Host = $vmh.Name
$myItem.VC = $defaultviserver.Name
$myItem.Version = $vmh.Version

#>>>>>>>>>Fetching Details>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

$myItem.ESXiShell_Timeout = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.ESXiShellTimeOut | Select -ExpandProperty Value
$myItem.SSH_Timeout = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.ESXiShellInteractiveTimeOut | Select -ExpandProperty Value
$myItem.Dcui_TimeOut = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.DcuiTimeOut | Select -ExpandProperty Value

#>>>>>>>>>>>>>>>>>>>>>setting the Value>>>>>>>>>>>>>>>>>>>>>>>>>>>

#$myItem.ESXiShell_Timeout = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.ESXiShellTimeOut | Set-AdvancedSetting -Value 0 -Confirm:$false | select -ExpandProperty value
#$myItem.SSH_Timeout = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.ESXiShellInteractiveTimeOut | Set-AdvancedSetting -Value 0 -Confirm:$false | select -ExpandProperty value
#$myItem.Dcui_TimeOut = Get-AdvancedSetting -Entity (Get-cluster | Get-VMhost $vmh) -name UserVars.DcuiTimeOut | Set-AdvancedSetting -Value 600 -Confirm:$false | select -ExpandProperty value

$HostData += $myItem
}
$HostData | export-csv -path d:\host.csv -NoTypeInformation

Thanks for visitng the site, if you like the content, kindly like and put comment.

code

text

Share this

About the Author

Jitendra
Jitendra
Contributer VMwareDiary.com

User's Comments


 
Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Comment