Get Eventlog details from a group of machines

Want to get recent events from a list of computers? Use the following Powershell command:

PS C:\> get-eventlog system -ComputerName (get-content c:\machines.txt) -Newest 10 | Select EventID, MachineName, EntryT
ype, Message | convertto-html > events.html

Not only will it export it in nice HTML, but you can change the parameters to choose a different log (say, System rather than Application) and also choose how many are returned (10 in this example).

Just make sure c:\machines.txt (or wherever) has a list of servers/PC’s in it.

 


					
Advertisements

Leave a comment

Filed under Powershell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s