Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Working with Windows event log and CSV file

Working with Windows event log and CSV file

Working with Windows event log and CSV file

Here is what I need to do.

  1. There is a CSV file with 3 columns (Datasource, eventID, project Code, description)
  2. Get a time stamp from a text file
  3. Grab all application log events that is newer than the time stamp
  4. Replace the time stamp to current time
  5. For each event (with the event datasource and eventID), match the datasource and eventID against the CSV file. If a datasource and eventID are matched, write a new event with a pre-defined fixed datasource name and ID, along with the corresponding project code description into this new event description.
At the end system center operations manager will pick up this particular new event and generate an Alert, which associate a project code. End users/administrators can modify the CSV file themselves to enable specific event log monitoring by their own
I planned work this out using Powershell with Import-CSV and Get-EventLog. However the script has to work on 2003 servers without powershell and deploying PowerShell on them is not allowed.

As I am not really a scripting guys. I would like know at least some high level procedures to work this out.
Get the CSV into an array?
Get those event logs into another array?
standardize format?
Cross matching?
write back event log

really lost......

RE: Working with Windows event log and CSV file

Since you seem more comfortable with Powershell than vbscript... I know very little about it, but can't powershell read a remote event log? Are you sure you need to install anything on the 2003 servers?

RE: Working with Windows event log and CSV file

Take a look here for some samples on reading a remote event log: https://msdn.microsoft.com/en-us/library/aa394593%...

Also take note that because you can read the desired data with WMI, you CAN use PowerShell to achieve your goal. PowerShell on your admin station would merely send WMI commands to the 2003. You do however need to have admin rights to read those logs and remote WMI needs to be configured on the 2003 boxes.

The only parts you are really concerned about are the WMI queries which you can easily translate to PowerShell code.

I hope that helps.



No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at http://www.thespidersparlor.com/vbscript


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close