Setting Syslog Configuration via Get-EsxCli -v2

Hi,

after battleing a little with Get-EsxiCli -v2 in the last couple of month I needed to write a quick script yesterday to reconfigure the Syslog Parameters on all Esxi Hosts.

A problem when you are coming from the old Get-EsxiCli is how to map the old command line to the new version. Luckily for us we have a helper:

$esxcli.system.syslog.config.set

will display a list of all functions you can use and

$esxcli.system.syslog.config.set.CreateArgs()

will return the hashtable values you can use to create the

$esxcli.system.syslog.config.set.invoke() 

syntax, for example

$esxcli.system.syslog.config.set.invoke(@{
defaultrotate = 8
loghost = 'udp://syslogServer:514'
})

Complete Source Code can be found here: syslogConfig.ps1

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s