<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>script on TRUE IT STORIES</title><link>https://neu.true-it-stories.com/tags/script/</link><description>Recent content in script on TRUE IT STORIES</description><generator>Hugo</generator><language>de-de</language><lastBuildDate>Tue, 07 Jan 2020 13:44:15 +0000</lastBuildDate><atom:link href="https://neu.true-it-stories.com/tags/script/index.xml" rel="self" type="application/rss+xml"/><item><title>Syslog HASHMAP</title><link>https://neu.true-it-stories.com/syslog-hashmap/</link><pubDate>Tue, 07 Jan 2020 13:44:15 +0000</pubDate><guid>https://neu.true-it-stories.com/syslog-hashmap/</guid><description>&lt;p&gt;I’ve a customer who have several DataCenters in the vCenter and each DataCenter needs different Syslog-Server. With this script you should be able to set for each Datacenter different Syslog-Server.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;#Map DC to log server:&#10; &#10;$servermap = @{&#10; &#10; &amp;#34;DC1&amp;#34; = &amp;#34;tcp://syslog01.v-crew.int:514,tcp://syslog02.v-crew.int:514&amp;#34;;&#10; &amp;#34;DC2&amp;#34; = &amp;#34;tcp://syslog03.v-crew.int:514,tcp://syslog04.v-crew.int:514&amp;#34;;&#10; &amp;#34;DC3&amp;#34; = &amp;#34;tcp://syslog05.v-crew.int:514,tcp://syslog06.v-crew.int:514&amp;#34;;&#10; &#10;};&#10; &#10; &#10; &#10;foreach ($vmhost in (Get-VMHost)) {&#10; &#10; $DC = (Get-Datacenter -VMHost $vmhost)&#10; &#10; echo $vmhost.Name &#10; &#10; echo $servermap.($DC.Name)&#10; &#10;&#10; $syslog = $servermap.($DC.Name)&#10; &#10; Get-AdvancedSetting -Entity $vmhost -Name &amp;#34;SysLog.Global.loghost&amp;#34; | Set-AdvancedSetting -Value $syslog -Confirm:$false&#10; &#10; Write-Host &amp;#34;Restarting syslog daemon.&amp;#34; -ForegroundColor Green&#10; &#10; $esxcli = Get-EsxCli -VMHost $vmhost -V2&#10; &#10; $esxcli.system.syslog.reload.Invoke()&#10; &#10; Write-Host &amp;#34;Setting firewall to allow Syslog out of $($vmhost)&amp;#34; -ForegroundColor Green&#10; &#10; Get-VMHostFirewallException -VMHost $vmhost | where {$_.name -eq &amp;#39;syslog&amp;#39;} | Set-VMHostFirewallException -Enabled:$true&#10; &#10;}&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href="https://github.com/Vaiper/syslog-servermap/blob/master/syslog-servermap.ps1"&gt;https://github.com/Vaiper/syslog-servermap/blob/master/syslog-servermap.ps1&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>