Created
April 6, 2016 21:13
-
-
Save omniproc/8d14682bb8fd7c924222b7a386a3a37c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The cluster you want to enable SSH on | |
$cluster = YOU_CLUSTER; | |
$hosts = Get-Cluster $cluster | Get-VMHost | |
#Start SSH service | |
$hosts | ForEach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.key -eq "TSM-SSH"})} | |
#Enable SSH service (start when ESXi boots) | |
$hosts | ForEach {Set-VMHostService -Policy On -HostService ($_ | Get-VMHostService | Where {$_.key -eq "TSM-SSH"})} | |
#Supress nasty SSH warning, we know what we're doing yade yade yade... | |
$hosts | ForEach {Get-AdvancedSetting UserVars.SuppressShellWarning | Set-AdvancedSetting -Value 1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starts and enables SSH for all ESXi hosts within a vCenter host cluster.