First, let’s check the SSH status on all nodes
Get-VMHost | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" } | select VMHost, Label, Running
The result should be something like this:
VMHost Label Running
------ ----- -------
esxi-02.xas.local SSH False
esxi-10.xas.local SSH False
esxi-06.xas.local SSH False
esxi-01.xas.local SSH False
esxi-05.xas.local SSH True
esxi-07.xas.local SSH False
esxi-03.xas.local SSH False
esxi-04.xas.local SSH False
esxi-08.xas.local SSH False
esxi-09.xas.local SSH False
Start SSH service on all hosts:
PS C:\Windows\system32> Get-VMHost | Foreach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )}
Key Label Policy Running Required
--- ----- ------ ------- --------
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
TSM-SSH SSH off True False
Set startup policy “Start with host” on all hosts:
PS C:\Windows\system32> Get-VMHost | get-vmhostservice | where-object {$_.key -eq "TSM-SSH"} | set-vmhostservice -policy "On"
Key Label Policy Running Required
--- ----- ------ ------- --------
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
TSM-SSH SSH on True False
Disable SSH warning on all hosts:
PS C:\Windows\system32> Get-VMHost | Get-AdvancedSetting -Name UserVars.SuppressShellWarning | Set-AdvancedSetting -Value 1 -Confirm:$false
Name Value Type Description
---- ----- ---- -----------
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost
UserVars.Suppress... 1 VMHost