Solved

Checking Windows Server 2003 Reboot in Event Viewer

Posted on 2006-06-27
3
4,448 Views
Last Modified: 2012-08-14
How can you tell that a server has been rebooted in Windows 2003 Server? Can you tell in Event Viewer? Or is their a better way? Thanks.

-Brian
0
Comment
Question by:Calv1n
3 Comments
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 16993132
event viewer is the best way, just look for when the services all give a successful start
0
 
LVL 13

Expert Comment

by:2hype
ID: 16993869
Yeah, You can check event view and there is information like when DHCP entered the running state ect..

Or you could Open Notepad.  Paste the Below Code in.  Save it as uptime.vbs - Now double click the file.  This file will tell you how many hours the computer has been running for since last reboot.

' Check for computers last reboot
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

Dim uptime
 
For Each objOS in colOperatingSystems
    dtmBootup = objOS.LastBootUpTime
    dtmLastBootupTime = WMIDateStringToDate(dtmBootup)
    dtmSystemUptime = DateDiff("h", dtmLastBootUpTime, Now)
    uptime = dtmSystemUptime
Next
Function WMIDateStringToDate(dtmBootup)
    WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & "/" & _
             Mid(dtmBootup, 7, 2) & "/" & Left(dtmBootup, 4) _
                 & " " & Mid (dtmBootup, 9, 2) & ":" & _
                     Mid(dtmBootup, 11, 2) & ":" & Mid(dtmBootup, _
                         13, 2))
End Function

WScript.Echo uptime
0
 
LVL 5

Accepted Solution

by:
davino_1 earned 125 total points
ID: 16996865
You can also do a "systeminfo" in the command prompt and look at the uptime.  This won't necessarily tell you if it was a sucessful reboot or not...
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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