Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 246952

Re: Enable SSH through Powercli

$
0
0

Hello, vicdaw-

 

Welcome to the communities.

 

Yes, you can enable/disable (start/stop) SSH (and VMHost services in general) with the Start-VMHostService and Stop-VMHostService cmdlets.  As such:

 

## start the SSH service on the given host
Get-VMHostService-VMHostmyVMHost0 | ?{$_.Label -eq"SSH"} | Start-VMHostService

## stop the SSH service on the given host
Get-VMHostService-VMHostmyVMHost0 | ?{$_.Label -eq"SSH"} | Stop-VMHostService-Confirm:$false

 

If you want to change services' start-up policy, you can use Set-VMHostService. Enjoy.


Viewing all articles
Browse latest Browse all 246952

Trending Articles