Link to home
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Find a given event id for a list of computers in a text file

Hi guys.

Im trying to build a script that will do the following.

script.vbs or .bat -e <event_viewer_id> <-h <number_of_hrs> or -a <get_all_events> -l computers.txt -o outputevents.txt

So, for example, if I wanted to get event id 6008 for the last 7 hours,

script.vbs -e 6008 -h 8 -l computers.txt -o outputevents.txt

or to get all events:

script.vbs -e 6008 -a -l computers.txt -o outputevents.txt

Format for the outputevents.txt would be something like:

======================================================== outputevents.txt

----------------------- <computer_name>:
6008      <time_date>   <-------------- most recent first
6008        time_date
6008
etc

----------------------- <computer_name>:
6008      <time_date>   <-------------- most recent first
6008        time_date
6008
etc

----------------------- <computer_name>:
6008      <time_date>   <-------------- most recent first
6008        time_date
6008
etc

Any help on this greatly appreciated.

ASKER CERTIFIED SOLUTION
Avatar of jwarnken
jwarnken
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Simon336697

ASKER

Thanks jwarnken. Ill have a look at this.