Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Write to the event log in Server 2000

Posted on 2008-06-16
3
Medium Priority
?
229 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

My previous article  (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html)detailed one possible method to get SCCM 2007 installed an…
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

971 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