<font size=2 face="sans-serif">Hello Zak,</font>
<br><font size=2 face="sans-serif">works perfect:</font>
<br>
<br><tt><font size=2>2015-02-19 12:34:41  Event Log processing - max
payload: 1024 - wanted logs: Application System Security</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Event log Application adding
to payload</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Processing event log Application</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  <b>Setting thread/UI culture
to en-US</b></font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  <b>Resetting thread/UI culture
to previous: de-DE / en-US</b></font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Event log Application entries
since last scan: 7</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Found a configured filter
for log Application</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Event log System adding
to payload</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  Processing event log System</font></tt>
<br><tt><font size=2>2015-02-19 12:34:41  <b>Setting thread/UI culture
to en-US</b></font></tt>
<br><tt><font size=2>2015-02-19 12:34:42  <b>Resetting thread/UI culture
to previous: de-DE / en-US</b></font></tt>
<br><tt><font size=2>2015-02-19 12:34:42  Event log System entries
since last scan: 3</font></tt>
<br><tt><font size=2>2015-02-19 12:34:42  Found a configured filter
for log System</font></tt>
<br><tt><font size=2>2015-02-19 12:34:42  Event log Security adding
to payload</font></tt>
<br><tt><font size=2>2015-02-19 12:34:42  Event log processing finished</font></tt>
<br><font size=2 face="sans-serif"><br>
<br>
Kind regards,</font>
<br><font size=2 face="sans-serif">Lukas<br>
</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">Von:      
 </font><font size=1 face="sans-serif"><zak.beck@accenture.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">An:      
 </font><font size=1 face="sans-serif"><lukas.kohl@ergodirekt.de></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Kopie:      
 </font><font size=1 face="sans-serif"><xymon@xymon.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Datum:      
 </font><font size=1 face="sans-serif">19.02.2015 11:51</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Betreff:    
   </font><font size=1 face="sans-serif">[SPAM] RE: [Xymon]
Xymon Powershell Windows client</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hi Lukas<br>
<br>
Thanks for reporting this.<br>
<br>
I have committed a patch based on your information - please try that.<br>
<br>
Regards<br>
<br>
Zak <br>
<br>
-----Original Message-----<br>
From: lukas.kohl@ergodirekt.de [</font></tt><a href=mailto:lukas.kohl@ergodirekt.de><tt><font size=2>mailto:lukas.kohl@ergodirekt.de</font></tt></a><tt><font size=2>]
<br>
Sent: 18 February 2015 16:00<br>
To: Beck, Zak<br>
Cc: xymon@xymon.com<br>
Subject: [Xymon] Xymon Powershell Windows client<br>
<br>
Hello Zak,<br>
today I recognized, that the msgs were sent broken:<br>
---<br>
Full log eventlog_Security<br>
 - 02/18/2015 13:54:50 - Microsoft-Windows-Security-Auditing -<br>
 - 02/18/2015 13:54:50 - Microsoft-Windows-Security-Auditing - <br>
<br>
Full log eventlog_Application<br>
 - 02/18/2015 13:54:51 - SceCli -<br>
---<br>
<br>
I managed to track the issue down to my CurrentCulture setting ($Host or<br>
Get-Culture), which was de-DE at my Server. When I changed it to en-US,<br>
everything seems to be correct again:<br>
---<br>
Full log eventlog_Application<br>
Information - 02/18/2015 16:04:57 - nssm - Started<br>
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy<br>
RemoteSigned -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File<br>
"C:\Program Files\xymonps\xymonclient.ps1" for service XymonPSClient
in<br>
C:\Windows\System32\WindowsPowerShell\v1.0.<br>
Information - 02/18/2015 16:04:56 - nssm - Service XymonPSClient received<br>
START control, which will be handled.<br>
Information - 02/18/2015 16:04:55 - nssm - Killing PID 5100 in process
tree<br>
of PID 5100 because service XymonPSClient is stopping.<br>
Information - 02/18/2015 16:04:55 - nssm - Killing process tree of process<br>
5100 for service XymonPSClient with exit code 0 Information - 02/18/2015<br>
16:04:54 - nssm - Killing process<br>
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe because service<br>
XymonPSClient is stopping.<br>
Information - 02/18/2015 16:04:54 - nssm - Service XymonPSClient received<br>
STOP control, which will be handled.<br>
Information - 02/18/2015 15:31:58 - Microsoft-Windows-Security-SPP - The<br>
Software Protection service has stopped.<br>
---<br>
<br>
The Problem is, that the commands [string]$entry.LevelDisplayName and<br>
[string]$entry.Message just return empty lines, when CurrentCulture is
set<br>
to anything different than en-US --><br>
</font></tt><a href=http://powershell.com/cs/forums/p/14969/29273.aspx><tt><font size=2>http://powershell.com/cs/forums/p/14969/29273.aspx</font></tt></a><tt><font size=2><br>
<br>
The behaviour can be fixed, when surrounding the Get-WinEvent with a<br>
different Culture (</font></tt><a href=http://poshcode.org/2226><tt><font size=2>http://poshcode.org/2226</font></tt></a><tt><font size=2>):<br>
<br>
function Set-Culture([System.Globalization.CultureInfo] $culture) {<br>
                
[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture<br>
                
[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture }<br>
$oldCulture = [System.Threading.Thread]::CurrentThread.CurrentUICulture<br>
trap { Set-Culture $oldCulture }<br>
Set-Culture en-US<br>
<br>
$logentries = @(Get-WinEvent -ErrorAction:SilentlyContinue -FilterXML<br>
$logFilterXML ` -MaxEvents $script:XymonSettings.MaxEvents)<br>
                
                 <br>
Set-Culture $oldCulture<br>
<br>
Aftwerwards, I can set the culture back to stock.<br>
<br>
Kind regards,<br>
Lukas<br>
</font></tt>
<br>
<br>
<br>
<font face="Microsoft Sans Serif">www.ergodirekt.de</font><br>
<br>
<font face="Microsoft Sans Serif">Blog: </font><font face="Microsoft Sans Serif"><a href="http://blog.ergodirekt.de">http://blog.ergodirekt.de</a></font><br>
<font face="Microsoft Sans Serif">Facebook: </font><font face="Microsoft Sans Serif">www.facebook.com/ERGODirekt</font><br>
<font face="Microsoft Sans Serif">Google+: </font><font face="Microsoft Sans Serif">www.google.com/+ergodirekt</font><font face="Microsoft Sans Serif"> </font><br>
<font face="Microsoft Sans Serif">Twitter: </font><font face="Microsoft Sans Serif">www.twitter.com/ERGODirekt</font><br>
<font face="Microsoft Sans Serif">YouTube: </font><font face="Microsoft Sans Serif">www.youtube.com/ERGODirekt</font><br>
<br>
<font face="Microsoft Sans Serif">_______________________</font><br>
<br>
<font face="Microsoft Sans Serif">ERGO Direkt Lebensversicherung AG · Amtsgericht Fürth HRB 2787 · UST-ID-Nr. DE159593454</font><br>
<font face="Microsoft Sans Serif">ERGO Direkt Versicherung AG · Amtsgericht Fürth HRB 2934 · UST-ID-Nr. DE159593438</font><br>
<font face="Microsoft Sans Serif">ERGO Direkt Krankenversicherung AG · Amtsgericht Fürth HRB 4694 · UST-ID-Nr. DE159593446</font><br>
<font face="Microsoft Sans Serif">Vorsitzender der Aufsichtsräte: Dr. Torsten Oletzky</font><br>
<font face="Microsoft Sans Serif">Vorstände: Dr. Daniel von Borries (Vorsitzender), Ralf Hartmann, Dr. Jörg Stoffels</font><br>
<font face="Microsoft Sans Serif">Sitz: Fürth</font><br>
<font face="Microsoft Sans Serif">Adresse: Karl-Martell-Straße 60 · 90344 Nürnberg · Deutschland</font>