Get-VM

Automating the World Around Me

Disable SSH Alert Script

| 0 comments

After posting how to disable the SSH alert through the GUI, a request came in for a script to automate the process. You ask, you shall receive!

If the SSH service is started in ESXi, an alert will be displayed on the host. This simple script will disable the alert for all hosts in your vCenter. The meat and potatoes of the script can be found below:

# Connect to vCenter using the variables above
Connect-VIServer -Server $VIServer -User $VC_User -Password $VC_Pass
 
# Gather all hosts connected to vCenter 
$Hosts = Get-VMHost
 
# Suppress the warning to all hosts
Set-VMHostAdvancedConfiguration -VMHost $Hosts -Name UserVars.SuppressShellWarning -Value 1
 
# Disconnect from vCenter
Disconnect-VIServer -Server $VIServer -Confirm:$false

The entire script can be downloaded from here.

Leave a Reply

Required fields are marked *.