Pull event logs quickly using Power Shell

Posted By on Jun 21, 2012 | 0 comments


[message_box type=”info” icon=”yes”]
Pull 10 newest Application logs:
get-eventlog application -newest 10 -message “*www.domaingoeshere.org*” | format-list *

Pull 10 newest System logs:
get-eventlog system -newest 10 -message “*www.domaingoeshere.org*” | format-list *

If you want to take the output of the get-eventlog cmdlet and pipe to a txt file do the following:

Pull 10 newest Application logs:
get-eventlog application -newest 10 -message “*www.domaingoeshere.org*” | format-list * | out-file c:output.txt

Pull 10 newest System logs:
get-eventlog system -newest 10 -message “*www.domaingoeshere.org*” | format-list * | out-file c:output.txt
[/message_box]