I am trying to create a basic script for our helpdesk agents which will allow them to view specific log files without having to open Event Viewer to save them time whilst on the phone.
However, I am having an issue with PowerShell where certain event ID's are not showing the actual event log message.
If I run the following:
Get-EventLog -ComputerName $env:COMPUTERNAME `
-LogName System `
-InstanceId 12 `
-Source Microsoft-Windows-Kernel-General |
Select-Object -Property Message
I would expect to receive the message shown in the actual event log:
Instead I get something along the lines of:
The description for Event ID '12' in Source
'Microsoft-Windows-Kernel-General' cannot be found. The local
computer may not have the necessary registry information or message
DLL files to display the message, or you may not have permission to
access them. The following information is part of the event:'10',
'0', '15063', '726', '0', '0',
'2018-03-18T16:59:34.495252300Z'
I seen another thread about using Get-WinEvent
unfortunately this is not possible in the environment I work in.