• Skip to primary navigation
  • Skip to main content

jdgreen.io

The personal blog of James Green

  • Home
  • Technology
    • Announcements
    • Industry
    • Reviews/Guides
    • Tech Field Day
    • Interviews
  • Health
    • Food
    • Biohacking
    • Fitness
  • Faith
  • Book Notes
    • Business Books
    • Faith Books
    • Health Books
    • Technology Books
  • About
  • Show Search
Hide Search

PowerCLI – Configure Syslog for All Hosts

James Green · Aug 10, 2015 ·

Here’s a quick bit of PowerCLI to configure syslog server on all hosts, place each hosts logs in a unique directory, and then enable the firewall exception to allow it to be used. This will do every host in the vCenter you’re connected to. I highly recommend that anyone managing a vSphere environment set up a syslog destination for ESXi. There’s nothing more frustrating than attempting root-cause analysis on a failure when logs aren’t persistent and in a central location.

Cheers!

[code language=”ps”] #Get all ESXi hosts
$hosts = Get-VMHost

#Update Syslog configuration
$hosts | Set-VMHostAdvancedConfiguration Syslog.global.logHost -Value 0.0.0.0
$hosts | Set-VMHostAdvancedConfiguration Syslog.global.logDirUnique -Value True

#Enable firewall exception
$hosts | Get-VMHostFirewallException | where {$_.Name.StartsWith(‘syslog’)} |
Set-VMHostFirewallException -Enabled $true
[/code]

VMware powercli, syslog

James Green is an enterprise IT consultant, a product of an amazing IT community, and a partner in ActualTech Media. He is a serial vExpert designee and a passionate Tech Field Day delegate and supporter. » Read Full Bio...

James Green: View My Blog Posts

Copyright © 2023 · Monochrome Pro on Genesis Framework · WordPress · Log in

Posting....