Questions tagged [get-eventlog]

Get-EventLog is a powershell cmdlet that gets the events in an event log, or a list of the event logs, on the local or remote computers.

Get-EventLog is a powershell cmdlet that gets the events in an event log, or a list of the event logs, on the local or remote computers. Get-EventLog only works against the 'classic' event logs - it is compatible with Windows XP and 2003. It is deprecated.

According to get-eventlog

Get-EventLog uses a Win32 API that is deprecated. The results may not be accurate. Use the Get-WinEvent cmdlet instead.

See also

49 questions
0
votes
3 answers

Powershell: How can I extract time from the message field of eventlog?

I'm trying to get unexpected shutdown times of Windows Sever 2008 machines via Get-EventLog in Powershell. I can get close by searching for events with an EventID of 6008 and selecting only message, but I need to parse within the field to grab the…
kiwisan
  • 449
  • 6
  • 16
0
votes
1 answer

Powershell Get-EventLog -before parameter not found

I have this snippet of code here: $currentDate = get-date $pastDate = $currentDate.addhours(-5) $errorCommand = get-eventlog -Before $currentDate -After $pastDate -logname Application -source "ESENT" $errorInfo = $errorCommand |…
Pensai
  • 9
  • 7
0
votes
2 answers

Using Get-EventLog in PowerShell how can I show only 10 characters in the message

I currently have the code below: Get-EventLog -LogName Application | Where-Object EventID -EQ 1033 | Select-Object EventID, Message So my question is how can I just show the first 10 characters of the Message?
Laitosto
  • 55
  • 1
  • 5
-2
votes
2 answers

read userinput and pass to Get-EventLog function

Please suggest the way forward for this, similarly I have to do for enddate, username etc. sample: $StartDate, $String = "", "" $StartDate = Read-Host -Prompt 'Enter the start date of the logs, Ex: 17/07/2017 09:00:00 ' if ($StartDate -and (…
San
  • 226
  • 5
  • 14
1 2 3
4