Using UCS PowerTool to Configure Syslog Servers

Share on:

Time for more UCS Scripting! This time to configure Syslog. The script is pretty straightforward, but nice to have to easily set up Syslog across multiple UCS domains.


Preparing to Execute the Script

The script is pretty straight forward, just need to define a few variables seen below and then you execute the script. I will walk you through the process.

 1# UCS PowerTool Script that to set Syslog
 2# @davidstamen
 5#Define Variables
 6$cred = Get-Credential
 7$domains = "ucs01.lab.local","ucs02.lab.local"
 8$SyslogServer = "syslog.lab.local"
 9$Name = "primary"
10$Facility = "local7"
11$AdminState = "enabled"
12$Severity = "notifications"
14#Cycles through each UCS setting values
15Foreach ($ucs in $domains) {
16  Connect-UCS $ucs -Credential $cred
17  Get-UcsSyslogClient -Name $Name | Set-UcsSyslogClient -AdminState $AdminState -ForwardingFacility $Facility -Hostname $SyslogServer -Severity $Severity -Force
18  Disconnect-UCS

Execute the Script

  • Run .\Set-UcsSyslog.ps1
comments powered by Disqus

See Also