Event Viewer and Restarts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey all,

Is it possible to have an Event logged every time the server is shutdown or
restarted
?

Like a Warning: Server Shutdown or Server Restarted

Just thought it would be very handy for looking back on logs
 
Adrian said:
Hey all,

Is it possible to have an Event logged every time the server is shutdown or
restarted
?

Like a Warning: Server Shutdown or Server Restarted

Just thought it would be very handy for looking back on logs

Probably easiest to invoke your own batch file:

Shutdown script:
@echo off
if not exist c:\Logs md c:\Logs
echo %date% %time:~0,5% Shutdown >> c:\Logs\%ComputerName%.log

Startup script:
@echo off
if not exist c:\Logs md c:\Logs
echo %date% %time:~0,5% Startup >> c:\Logs\%ComputerName%.log

Run GPEDIT.MSC, then open up
- Local Computer Policy
- Computer Configuration
- Windows Settings
- Scripts (Startup / Shutdown)
- Enter the names of your script files
 
Happens by default. Every time the machine is restart the system log shows

Event Type: Information
Event Source: EventLog
Event Category: None
Event ID: 6005
Date: 11/4/2006
Time: 9:45:55 AM
User: N/A
Computer: DELL670
Description:
The Event log service was started.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hey all,
|
| Is it possible to have an Event logged every time the server is shutdown
or
| restarted
| ?
|
| Like a Warning: Server Shutdown or Server Restarted
|
| Just thought it would be very handy for looking back on logs
 
Thanks Dave and Pegasus.

I was hoping to be able to create a Warning Message in the System and
Application Event Logs something would just stand out so I could see
instantly from within the event logs when the server was shutdown or started.

While I've seem the one you mentioned Dave, I wanted something more definite
that the Server was shutdown and not just on the off chance Event Viewer.

Pegasus the information you provide was great thank you, is it possible to
get to add that info into the actual event application event log rather than
a seperate file?

Ive tried to use
@echo off
if not exist c:\Logs md c:\Logs
echo %date% %time:~0,5% Shutdown >> C:\WINDOWS\system32\config\AppEvent.Evt

But it wont add the Message in
 
Adrian said:
Thanks Dave and Pegasus.

I was hoping to be able to create a Warning Message in the System and
Application Event Logs something would just stand out so I could see
instantly from within the event logs when the server was shutdown or started.

While I've seem the one you mentioned Dave, I wanted something more definite
that the Server was shutdown and not just on the off chance Event Viewer.

Pegasus the information you provide was great thank you, is it possible to
get to add that info into the actual event application event log rather than
a seperate file?

Ive tried to use
@echo off
if not exist c:\Logs md c:\Logs
echo %date% %time:~0,5% Shutdown >> C:\WINDOWS\system32\config\AppEvent.Evt

But it wont add the Message in

The event viewer uses its own special format. Your method would
corrupt it if successful!

You can use logevent.exe to add your own events to the event
viewer. The program comes with the Windows Resource Kit.
However, these events won't exactly stand out - they will be among
the great many other events visible in the event viewer.
 
You can filter the event log for the 6005 event.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Thanks Dave and Pegasus.
|
| I was hoping to be able to create a Warning Message in the System and
| Application Event Logs something would just stand out so I could see
| instantly from within the event logs when the server was shutdown or
started.
|
| While I've seem the one you mentioned Dave, I wanted something more
definite
| that the Server was shutdown and not just on the off chance Event Viewer.
|
| Pegasus the information you provide was great thank you, is it possible to
| get to add that info into the actual event application event log rather
than
| a seperate file?
|
| Ive tried to use
| @echo off
| if not exist c:\Logs md c:\Logs
| echo %date% %time:~0,5% Shutdown >>
C:\WINDOWS\system32\config\AppEvent.Evt
|
| But it wont add the Message in
 
Back
Top