• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

How can i search for a particular event log in all the machines in the file and get the results to a file

Hi,

How can i search for a particular event log in all the machines in the file and get the results to a file.

Is there a way to do this.

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 3
  • 2
1 Solution
 
jordibartrinaCommented:
You can export all events to a flat file, like .csv, .txt. Merge all and filter with some text editor. It's possible to automate this procedure with a little script.

Don't hesitate contact again for any question
0
 
Farhan KaziSystems EngineerCommented:
Hi Sharath,

You can achieve this using Windows builtin command line tool called WMIC.

Click Start -> Run -> Cmd.exe

WMIC /NODE:@Computers.txt /OUTPUT:C:\EventsOutput.txt NTEVENT WHERE "EventCode='517'" GET /FORMAT:LIST

* You can use /NODE with to supply file with computer names. Put all you computer names inside Computer.txt file.
* In WHERE clause you can set 'EventCode' field with the event id you are interested in.
* You can set output file name location through /OUTPUT switch.
* You can set output file format using /FORMAT switch (available formats are LIST, CSV, HFORM, TABLE, HXML, VALUE etc..)

Hope this helps!
Farhan
0
 
Farhan KaziSystems EngineerCommented:
Thanks Sharath,

Little amendment in my above statement.

WMIC /NODE:@"Computers.txt" /OUTPUT:C:\EventsOutput.txt NTEVENT WHERE "EventCode='517'" GET /FORMAT:LIST         ^--- enclose file name inside double quotes.
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
bsharathAuthor Commented:
Farhan without the "" also i was able to get the results...
0
 
Farhan KaziSystems EngineerCommented:
Yes, but if filename contains any space then it will generate an error.
0
 
bsharathAuthor Commented:
Ok Farhan thanks...
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now