Script that retrieves info from Event logs

As example, I need to search in event viewer to find logon/logoff history of User1,User2,…Userx

I can do that manually, by right clicking on System log or Security log then click find, then type the user name, this will work, but it takes too long to display the info

I need a Script that prompts me to enter the type of the log; system/application/security  then enter username and let the script funnel through the logs and display the info, or dump the output to a file.

Any gel will be very much appreciated.

Thanks
jskfanAsked:
Who is Participating?
 
Rick HobbsConnect With a Mentor RETIREDCommented:
From the third link supplied, it should display all entries that match what you are looking for.  You could, if you want, pipe the output to a file for later perusal.
0
 
Rainer JeschorCommented:
Hi,
short question: are you sticked to VBScript or are you also open for Powershell?
Thanks.
Rainer
0
 
jskfanAuthor Commented:
I checked the links above…
What I need is the event logs that are logged for a certain object, for instance a certain user, when did he logon successfully.
I use the built in Find option of the event logs, but it takes too long to show the results and then I will have to click next to go to  the next event related to user object….
0
 
jskfanAuthor Commented:
I wil check it later..
Thanks
0
All Courses

From novice to tech pro — start learning today.