Windows Scripting
  Home arrow Windows Scripting arrow Parsing Event Logs in WSH
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Parsing Event Logs in WSH
By: Nilpo/Developer Shed Staff Writer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-05-21

    Table of Contents:
  • Parsing Event Logs in WSH
  • Using WMI to access NT Log events
  • Creating the database
  • Adding event data to the database

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Parsing Event Logs in WSH


    (Page 1 of 4 )

    Event Logs provide a very informative tool for system administrators. They can serve as an early warning system for system failures and can aid greatly in the detection and resolution of existing problems. Today we’re going to explore ways of using WSH to parse that information for better analysis and archival purposes.

    To begin, I’m going to demonstrate how to use WMI in conjunction with WSH to read events in the various Win32 event logs.  We’re going to read this information into a database.  This database could be used as a simple archive, or to sort the data for easier analysis.

    I’m going to use Microsoft’s Jet driver simply because it’s very common.  You can use any database driver you like.  I’m also going to build an MDB (Microsoft Access) database, again because it’s common.

    Different database drivers support different levels of functionality.  Some even support different properties and methods.  If you’re unsure about the one you choose, MSDN is a good place to find that documentation.  Chances are good that you can just drop in this code and run with it anyway.

    Finally, I’m not going to go into great detail about manipulating this information.  I’m assuming that you are either familiar with working with databases or are at least familiar with database management software like Access.  My focus in this article series is going to be setting up the database and the strategy behind that.

    This project is actually two-fold.  While the immediate benefits of moving this information to a database are obvious, there is much more to be had here.  Over the course of this article series, I’ll be building upon this base idea to develop a really nice solution for network and system administrators alike.

    But I’m not letting the cat out of the bag on that just yet; you’re going to have to come back for the rest of the articles.  I promise you’re going to like what I’ve come up with this time.

    Put on your coding caps and fill up those coffee cups.  Let’s get started!

    More Windows Scripting Articles
    More By Nilpo/Developer Shed Staff Writer


       · Event logs can help a good system or network administrator be more effective. Learn...
     

    WINDOWS SCRIPTING ARTICLES

    - Printing Documents in WSH
    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory
    - Moving and Renaming Computers with Active Di...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway