Last active
January 12, 2016 21:48
-
-
Save tatapbl4/3c5acd8f89ff7cda8258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LogInsightServer = "tcp:|udp://fqdn-or-ip:514" | |
Get-VMHost | Foreach { | |
Write-Host "Adding $LogInsightServer as Syslog server for $($_.Name)" | |
$SetSyslog = Set-VMHostSyslogServer -SyslogServer $LogInsightServer -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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment