SSH_Check-Enable-Supress_Warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | CLS #Connect to vCenter or individual ESXi Host Connect-VIServer {vCenter FQDN} -User {Username} -Password {Password} #Checks to see if SSH is running on ESXi Hosts and Sort by ESXi Host Get-VMHost | Get-VMHostService | Where { $_.Key -eq "TSM-SSH" } |select VMHost, Label, Running |sort VMHost # Enables SSH service on all Hosts and sets the service to automatic Get-VMHost | Foreach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )} Get-VMHost | Get-VmHostService | Where-Object {$_.key -eq "TSM-SSH"} | Start-VMHostService Get-VMhost | Get-VmHostService | Where-Object {$_.key -eq "TSM-SSH"} | Set-VMHostService -policy "automatic" #Disables Yellow Warning and enables the SupressShellWarning Get-VMHost | Set-VmHostAdvancedConfiguration -Name UserVars.SuppressShellWarning -Value 1 #Disconnects vCenter Disconnect-VIServer -Force -Confirm:$false |