Quick Question!

V

Vee

Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows 2000 n
2003 servers
 
T

Torgeir Bakken \(MVP\)

Vee said:
Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows 2000 n
2003 servers
Hi

A)
Uptime.exe in the Windows 2000 Resource Kit (buy-ware).

And if you don't have the Win2k Resource Kit, a NT4/Win2k version
is available as a free download, I would guess it works against
newer OS as well:

http://www.microsoft.com/ntserver/nts/downloads/management/uptime/default.asp


B)
Or you can e.g. use PsInfo.exe for this:

Local computer: Psinfo.exe uptime
Remote computer: Psinfo.exe uptime \\somecomputer

PSInfo.exe is in the in the free PsTools suite found at
http://www.sysinternals.com/


C)

Or you can use VBScript/WMI for this:

http://groups.google.com/[email protected]
 
D

Dave Shaw [MVP]

Beg to differ, but UPTIME works perfectly well on all my Windows 2003
servers - and I have hundereds of them.

-ds


Vee said:
THe utilty Uptime does not work on Windows 2003 !!
 
S

Sameh Ahmed

I have a small vb.net exe that I created
It works on 2003 as well
I can post the code if you want it.
Vee said:
THe utilty Uptime does not work on Windows 2003 !!


Vee said:
Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows
2000
 
A

Andrew Mitchell

Vee said:
Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows 2000 n
2003 servers

You couls use any of the utilities mentioned in any of the posts that have
preceded mine, or you could just check the date/time on the pagefile using
Explorer and work it out from there.
 
T

Torgeir Bakken \(MVP\)

Vee said:
THe utilty Uptime does not work on Windows 2003 !!
Hi

I just tested uptime.exe (from the download link in my first post
on a Win2k3 Server and it worked fine. Note that you need to run
it in a command prompt to see the output.
 
V

Vee

I will give UPtime another try on a different W2k3 Server- (however not a
big fan of this utility)

Sameh, if you would please post your VB script;
Thanks a bunch!!
 
T

Torgeir Bakken \(MVP\)

Sameh said:
Vee
actually it's VB.NET application, WMI also
I copied this script below for you from the script center
Set dtmConvertedDate =
CreateObject("WbemScripting.SWbemDateTime")strComputer = "."Set
objWMIService = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set
colOperatingSystems = objWMIService.ExecQuery _ ("Select * from
Win32_OperatingSystem")For Each objOS in colOperatingSystems
dtmConvertedDate.Value = objOS.LastBootUpTime dtmLastBootUpTime =
dtmConvertedDate.GetVarDate dtmSystemUptime = DateDiff("d",
dtmLastBootUpTime, Now) Wscript.Echo dtmSystemUptime Next
news:[email protected]...
Hi

Note that the script above will not work if you run it from a
Windows 2000 computer (the "WbemScripting.SWbemDateTime" object
is not available there).

Also, objOS.LastBootUpTime is known to often not return a value
for some reason (bug).

Here is another VBScript/WMI script that will work on Win2k and
up (using SystemUpTime from Win32_PerfRawData_PerfOS_System):

http://groups.google.com/[email protected]
 
S

Sameh Ahmed

Vee
actually it's VB.NET application, WMI also
I copied this script below for you from the script center
Set dtmConvertedDate =
CreateObject("WbemScripting.SWbemDateTime")strComputer = "."Set
objWMIService = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set
colOperatingSystems = objWMIService.ExecQuery _ ("Select * from
Win32_OperatingSystem")For Each objOS in colOperatingSystems
dtmConvertedDate.Value = objOS.LastBootUpTime dtmLastBootUpTime =
dtmConvertedDate.GetVarDate dtmSystemUptime = DateDiff("d",
dtmLastBootUpTime, Now) Wscript.Echo dtmSystemUptime Next
Vee said:
I will give UPtime another try on a different W2k3 Server- (however not a
big fan of this utility)

Sameh, if you would please post your VB script;
Thanks a bunch!!


Vee said:
Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows
2000
 
M

MOTE

Vee said:
THe utilty Uptime does not work on Windows 2003 !!


Vee said:
Anyone know of a MS utility or otherwise to check uptime on server? Or more
specifically when the server was last rebooted? I am running Windows
2000
n
2003 servers


Vee,

How about " net statistics workstation | more " . This always works!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top