Backtrack:  
 
showing posts of December 14th, 2017
 
edited by on December 14th 2017, at 14:03

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).

edited by on December 14th 2017, at 14:00
If you're making changes to the datastore, setting up a new cluster and have a lot of hosts, and wish to set up system logging, you can do so very quickly using PowerCLI.

First, add all the hosts to the vCenter like you normally would. Then, connect to the vCenter server and run this cmdlet:

Get-VMHost | % { $vm = $_ $vm | Get-AdvancedSetting "Syslog.global.logDirUnique" | Set-AdvancedSetting -Value "True" -Confirm:$false $vm | Get-AdvancedSetting "Syslog.global.logDir" | Set-AdvancedSetting -Value "[DataStore01] ESXiLogs" -Confirm:$false}

The cmdlet above will set the system log location to a folder on DataStore01 and enables unique log di  ...
 
showing posts of December 14th, 2017
 
 
« March 2024»
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      
 
Links
 
Quote
« When a bird does poo poo in your eye, be happy elephants don't fly. »