Backtrack:  
 
by lunarg 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 directory to create a folder for each host.

By adjusting the cmdlet above, you can also quickly set other advanced settings, too!

 
 
« October 2024»
SunMonTueWedThuFriSat
  12345
6789101112
13141516171819
20212223242526
2728293031  
 
Links
 
Quote
« I needed a password with eight characters so I picked Snow White and the Seven Dwarves. »