Windows – Find your “Uptime”


KB ID 0000552 Dtd 09/01/12


There are lots of reasons you might want to know your PC/Servers uptime, to make sure a client has rebooted a server (like you asked them to), or to see if a server has had a BSOD and rebooted overnight, etc.

This article will provide info on,

Getting the Local Machines Uptime

Getting a Remote Machines Uptime


Getting the local machines uptime

Option 1 - Check Uptime with Task Manager

1. Starting with Windows Vista/2008 you can get your uptime from the Task Manager's "Performance" tab.

To launch Task Manger

a. Start > Run > Taskmgr.exe {enter}.
c. Right click the Task bar > Select Task Manager.

task manager uptime

Option 2 - Use Systeminfo to find Uptime

1. From command line execute the "Systeminfo" command, this lists quite a lot of information so you will need to scroll back up to the top, from here you can locate the machines "System Boot Time".

systeminfo command

2. You can make the results shorter by "Piping" the results with the following command;

systeminfo | find "System Boot Time:"

find uptime

Option 3 -Use Net Statistics to find Uptime

1. You can get uptime information by either querying the workstation service, or the server service, issue either, the following command;

net statistics workstation

net statistics workstation

Or the following command;

net statistics server

net statistics server

Option 4 - Use Uptime.exe to find Uptime

1. Download uptime.exe and put a copy in your "System32" Directory, you can then use the uptime command.

uptime command

Option 5 - Use WMI (Windows Management Instrumentation) to find Uptime

1. Issue the following command;

wmic os get lastbootuptime

wmi get uptime

As you can see the result is not pretty, it is presented in UTC format.

20120109081112.925800+000 = Year 2010, Month 01, Day 09, Time 08:11:12

Option 6 - Check the Event Log to find Uptime

1. Launch the Event Viewer (eventvr.msc) > Windows Logs > System Log > Find > Search for Event 6015, (Note: This event gets logged each time the server boots, as the event log service starts).

event log uptime

Note: Starting with Windows Server 2003, Event 6013 is periodically logged this shows the machines uptime at that point.

uptime evet 6013

Option 7 - Use Powershell to find Uptime

1. Windows 7 and Server 2008 R2 come with Powershell installed by default,

Download Powershell for Windows

Windows XP go here. Windows Vista x32 go here, Windows Vista x64 go here, Windows Server 2008 x32 go here, Windows Server 2008 x64 go here,

From the Powershell console execute the following command;

Write-Host “System has been up for” ((Get-Date) – ([WMI]“”).ConverttoDateTime((Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime)).Days “Days” ((Get-Date) – ([WMI]“”).ConverttoDateTime((Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime)).Hours “Hrs” ((Get-Date) – ([WMI]“”).ConverttoDateTime((Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime)).minutes “Min”

Poweshell Get Uptime

Or if that's to long the following will also work;

[Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime)

Poweshell Get Uptime

Getting a Remote Machines Uptime

Option 1 - Use Uptime.exe to get a Remote Machines Uptime

1. Already mentioned above download uptime.exe and extract it to your system32 directory. Then to get a remote machines uptime, use the following command;

uptime {Name of Remote PC}

Get Remote Machines Uptime

Option 2 - Use Powershell to get a Remote Machines Uptime

1. To do this your best best is to create a "function", then call that function in a command. Open the Powershell console and create a function called Remote-Uptime

function Remote-Uptime {
foreach($comp in $args)
$upTime = [Management.ManagementDateTimeConverter]::ToDateTime((gwmi win32_operatingsystem -computer $comp).lastbootuptime)
write-host $comp "-> server is up since" $upTime "which means" ([datetime]::now - $upTime).Days "days"

Note: You will need to press {Enter} to get back to the command prompt again.

Then call the function like so;

Remote-UpTime {machine name1} {machine name2}

PowerShell Remote Mchines Uptime

Related Articles, References, Credits, or External Links


Author: Migrated

Share This Post On