Using PowerCLI to change the Syslog server for your ESX host.

I recently discovered SexiLog to use with VMware ESX host.  I needed a quick and easy way to change where the ESX host sent there logs to.  Doing some google searches I was able to put together a quick PowerCLI script.  In about 5 minutes I was able to change the syslog for all of my ESX host.

$ESXLOG = “”
Get-VMHost | Foreach {
Write-Host “Adding $ESXLOG as Syslog server for $($_.Name)”
$SetSyslog = Set-VMHostSysLogServer -SysLogServer $ESXLOG -SysLogServerPort 514 -VMHost $_
Write-Host “Reloading Syslog on $($_.Name)”
$Reload = (Get-ESXCLI -VMHost $_).System.Syslog.reload()
Write-Host “Setting firewall to allow Syslog out of $($_)”
$FW = $_ | Get-VMHostFirewallException | Where {$_.Name -eq ‘syslog’} | Set-VMHostFirewallException -Enabled:$true

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

Up ↑

%d bloggers like this: