0

When I try to run cmd get-eventlog -list on win2003 std in powershell V2.0. It gives me the following output

 Max(K) Retain OverflowAction        Entries Log
 ------ ------ --------------        ------- ---
 16,384      0 OverwriteAsNeeded         117 Application
 512      7 OverwriteOlder              0 Internet Explorer
 20,480      0 OverwriteAsNeeded           0 Microsoft-Windows-Forwarding/Operational
 16,384      0 OverwriteAsNeeded         136 Security
 16,384      0 OverwriteAsNeeded         173 System
 15,360      0 OverwriteAsNeeded          83 Windows PowerShell

When try to run get-eventlog "Internet Explorer", it gives me Error

Get-EventLog : No matches found
At line:1 char:13
+ get-eventlog <<<<   $event
    + CategoryInfo          : ObjectNotFound: (:) [Get-EventLog], ArgumentException
    + FullyQualifiedErrorId : GetEventLogNoEntriesFound,Microsoft.PowerShell.Commands.GetEventLogCommand

Can someone help me resolve the issue?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
user564769
  • 43
  • 9

2 Answers2

0

It's simply because your log was empty at the moment !

JPBlanc
  • 70,406
  • 17
  • 130
  • 175
0

You are getting the exception because it's empty, BUT you can still get the object by doing this:

$ieLog = get-eventlog -list | where-object {$_.Log -eq "Internet Explorer"}

To verify that you really did get the correct log, try writing something in there:

$ieLog.Source = "Testing"
$ieLog.WriteEntry("Write Succeeded")
Tung
  • 5,334
  • 1
  • 34
  • 41