Solved

Write to the event log in Server 2000

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

The environment that this is running in is SCCM 2007 R2 running on a Windows 2008 R2 server. The PXE Distribution point is running on its own Windows 2008 R2 box. This is what Event viewer showed after trying to start the WDS service:  An erro…
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

10 Experts available now in Live!

Get 1:1 Help Now