Sometimes, you need to temporarily start a service (such as SSH) to perform some maintenance task. PowerCLI can help you with this:
To start the SSH server on each host of a vCenter:
Get-VMHost | Get-VMHostService | ? {$_.Key -eq "TSM-SSH"} | Start-VMHostService
To stop the SSH server:
Get-VMHost | Get-VMHostService | ? {$_.Key -eq "TSM-SSH"} | Stop-VMHostService -Confirm:$false
As always, you can make adjustments to the oneliner to select another service to start/stop, or further limit the selection of hosts to a cluster or a group of hosts (e.g. filtered by name).
« ‹ | December 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |