From time to time I need to go connect on the ESXi using SSH. I know it is not best practice, still I have to do it. And the most simple task transforms into a pain - starting and stopping SSH server on several ESXi hosts. The following small piece of PowerCLI does the job just fine:
- starting ssh service
- stopping ssh service
Get-Cluster CLS01 | Get-VMHost | Get-VMHostService | Where {$_.Key -eq "TSM-SSH"} | Stop-VMHostService -Confirm:$false
Since get-vmhostservice returns all services on ESXi host, you can use this to start/stop any service.
1 comment:
Hello mate greeat blog
Post a Comment