Open an elevated command prompt and:
- systeminfo | find “System Boot Time:”
Our report:
C:\>systeminfo | find "System Boot Time:"
System Boot Time: 1/3/2012, 11:22:30 AM
Hat tip: Petri: Seven Simple Ways to Find Your Uptime in Windows Server 2008
Note that this command can be run on almost any Windows OS.
UPDATE: Thanks to vNiklas we have the following PowerShell command run via an elevated PowerShell session:
- (get-date)-([System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject win32_operatingsystem).lastbootuptime)) [Enter]
Our output:
PS C:\> (get-date)-([System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject win32_operatingsystem).lastbootuptime))
Days : 6
Hours : 4
Minutes : 44
Seconds : 31
Milliseconds : 872
Ticks : 5354718724344
TotalDays : 6.19759111613889
TotalHours : 148.742186787333
TotalMinutes : 8924.53120724
TotalSeconds : 535471.8724344
TotalMilliseconds : 535471872.4344
Philip Elder
MPECS Inc.
Microsoft Small Business Specialists
Co-Author: SBS 2008 Blueprint Book
*Our original iMac was stolen (previous blog post). We now have a new MacBook Pro courtesy of Vlad Mazek, owner of OWN.
if you are using powershell instead you can use following oneliner (get-date)-([System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject win32_operatingsystem).lastbootuptime))
ReplyDeleteAnd there you will not have to do the math and count days :-)
Still using NT4's uptime.exe utility! :-)
ReplyDeleteI prefer uptime.exe as well. It's fast and easy to remember. I just drop it into System32 on PCs.
ReplyDelete\\XXXX has been up for: 0 day(s), 11 hour(s), 32 minute(s), 18 second(s)
I'm doing my head in trying to extract just the minutes out of that?
ReplyDeleteTo date we have used this command line to have a good idea of where we are at time wise.
ReplyDeleteFor the most part we reboot all nodes in a cluster on the same day so we are looking for anomalies in time that indicate a node problem.
Thanks folks!
Philip