06 September,2014 by Jack Vamvas
Question: I have jobs scheduled through Windows task Scheduler on multiple servers. How can I return the Task Scheduler Event Log information with the messages appearing?
I’ve executed this code , but the messages are not appearing , how can I fix? I’m using Powershell version 3
get-winevent -logname microsoft-windows-taskscheduler/operational -maxevents 20 | ft id,message
Answer: If you execute the Powershell cmdlet Get-Culture , you’ll notice the name is not en-US. There is a bug . If the Current culture is not set to en-US the messages will not appear. The command will run , but not return the content in the Messages column
A workaround to make the messages appear is to set the current thread as en-US
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US" get-winevent -logname microsoft-windows-taskscheduler/operational -maxevents 20 | ft id,message