Solved

Write to the event log in Server 2000

Posted on 2008-06-16
3
192 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

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The question has been asked on multiple occasions as to how best to do printing in a remote desktop or terminal services environment.   It seems that this particular question has plagued several people and most especially as Terminal Services, as…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found here: http://www.experts-exchang…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

20 Experts available now in Live!

Get 1:1 Help Now