Solved

Write to the event log in Server 2000

Posted on 2008-06-16
3
184 Views
Last Modified: 2013-12-05
Does anyone know if there is a way to write a customized event to the system or application event log in server 2000?  

On XP /Server 2003 it can be done with the Eventcreate command, but that command doesn't work on 2000
0
Comment
Question by:ITApprendista
  • 2
3 Comments
 
LVL 9

Expert Comment

by:gregcmcse
ID: 21796661
I'm not sure what language you're writing in, but check out this page:
http://www.microsoft.com/technet/scriptcenter/guide/sas_log_akqy.mspx?mfr=true

Basically, for VBScript (can be modified for VB too):

Set WSH = Wscript.CreateObject("Wscript.Shell")
WSH.LogEvent 0, "Success doing what I wanted!"

I think you can create the "Wscript.Shell" object in any MS Visual language or in javascript also.

I don't have 2000 anywhere anymore, so I can't test this code... it doesn't seem to work in XP but I'm now on a MUCH more recent version of the Windows Script Host language than what 2000 has.

Hope this helps!
0
 

Author Comment

by:ITApprendista
ID: 21796916
Yeah, I was planning on using vbscript.  The only problem with above method is that as far as I know you can never edit the source.  The source is always going to be WSH.  Otherwise though I might have to go that route.
0
 
LVL 9

Accepted Solution

by:
gregcmcse earned 500 total points
ID: 21796975
Well... the other option is using WSH.Run to run an outside app and then call the Windows 2000 Resource Kit tool Logevent.exe.

http://support.microsoft.com/kb/315410

If you don't have a copy of the W2K ResKit, I can see if I can find you a spot to get it from.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Case Summary: In this Article we introduce the new method to configure the default user profile using Automated profile copy with sysprep rather than the old ways such as the manual copy of a configured profile to default user profile Old meth…
Every system administrator encounters once in while in a problem where the solution seems to be a needle in haystack.  My needle was an anti-virus version causing problems with my Exchange server. I have an HP DL350 with Windows Server 2008 Stand…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now