Skip to content

Instantly share code, notes, and snippets.

@omniproc
Created April 6, 2016 21:13
Show Gist options
  • Save omniproc/8d14682bb8fd7c924222b7a386a3a37c to your computer and use it in GitHub Desktop.
Save omniproc/8d14682bb8fd7c924222b7a386a3a37c to your computer and use it in GitHub Desktop.
#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}
@omniproc
Copy link
Author

omniproc commented Apr 6, 2016

Starts and enables SSH for all ESXi hosts within a vCenter host cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment