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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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


    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

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek