06 September,2014 by Tom Collins
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
Powershell , Excel charts and data presentation
Powershell sql server security audit
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |