Hello!
I'v been using MS Log Parser for many years for parsing Windows logs and have decided to try to find the same information using PS. The results puzzled me a great deal so I would appreciate any help in interpreting them.
1) For finding event 4660 (File deletion) I'm used to run the following command:
LogParser -o:csv -tabs:ON SELECT TimeGenerated, EventID, Extract_Token(Strings, 1, |) AS USER, Extract_Token(Strings, 3, |) AS LogonID, Extract_Token(Strings, 5, |) AS HandleID FROM Security WHERE EventID = 4660 ORDER BY TimeGenerated DESC
This command works exactly as expected and it takes about 2 seconds to complete:
The ~same command in PS:
get-eventlog -LogName security where {$_.ID -eq 4660} |Select TimeCreated, Message |FT -AutoSize
It takes about 4 MINUTES to complete and it shows only one event:
Q1: Is it normal that PS command requires much more time to complete (1.7 SECONDS vs ~ 4 MINUTES) compared to Log Parser?
Q2: Why does PS show only one of thre existing events?
Q3: Why does -AutoSize do not work?
Please see the next post.