is there any way to enable/disable the remote tech support (SSH) from PowerCLI?
Get-VMHost | Foreach {
Stop-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} ) -Confirm:$false
}
Get-VMHost | Foreach {
Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )
}
to stop replace Start-VMHostService with Stop-VMHostService
Get-VMHost | Foreach {
Stop-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} ) -Confirm:$false
}
Have a look at Alan's post called PowerCLI: Technical Support Mode
The difference with the Start-VMHost service is that this way is permanent and doesn't need to be redone after a reboot.
Note that you will see a warning message in the vSphere Client for this ESXi server.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference