VMware Cloud Community
gsk308
Enthusiast
Enthusiast
Jump to solution

enable SSH

is there any way to enable/disable the remote tech support (SSH) from PowerCLI?

0 Kudos
1 Solution

Accepted Solutions
vlife201110141
Enthusiast
Enthusiast
Jump to solution

Get-VMHost | Foreach {

Stop-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} ) -Confirm:$false

}

View solution in original post

0 Kudos
4 Replies
vlife201110141
Enthusiast
Enthusiast
Jump to solution

Get-VMHost | Foreach {

Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )

}

0 Kudos
vlife201110141
Enthusiast
Enthusiast
Jump to solution

to stop replace Start-VMHostService with Stop-VMHostService

0 Kudos
vlife201110141
Enthusiast
Enthusiast
Jump to solution

Get-VMHost | Foreach {

Stop-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} ) -Confirm:$false

}

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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