How do I check uptime on Windows, and why is it wrong after a shutdown?
Open Task Manager > Performance > CPU and read the "Up time" line. In PowerShell, run (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime. From cmd, systeminfo | find "System Boot Time" prints the boot time.
On Windows 10 and 11, Fast Startup is on by default, and with it Shut down resets none of these numbers: a shutdown hibernates the kernel and the next power-on resumes it. Only Restart is a real boot. That is why a PC that is turned off every night can show weeks of uptime, and why updates waiting on a reboot never finish.
The ticket says patches are failing, and the user swears the PC is off every night, yet the uptime counter shows three weeks. Both can be true. On Windows 10 and 11 the default Shut down does not end the boot: Windows saves the kernel session to disk and the next power-on resumes it, so the counter keeps running. Only a restart starts a fresh boot.
That is also why updates sit waiting for a reboot that never comes. Below: how to read uptime, how to tell whether Fast Startup is skewing it, and how to find out who restarted a machine or whether it crashed.
How do I check uptime on Windows?
There are four ways, and which one fits depends on whether you or the user is at the keyboard.
Task Manager. Performance tab, CPU, the "Up time" line, shown as days:hours:minutes:seconds. Use it when the user is on the phone and you need them to read a number off their own screen.
PowerShell. This gives you the boot timestamp and the elapsed time, and works in both Windows PowerShell 5.1 and PowerShell 7:
$os = Get-CimInstance Win32_OperatingSystem
$os.LastBootUpTime
(Get-Date) - $os.LastBootUpTime
The same check is on the last boot time script page, ready to save and reuse.
PowerShell 7 adds Get-Uptime, which returns a TimeSpan, and Get-Uptime -Since, which returns the boot time. It arrived in PowerShell 6.0, so the Windows PowerShell 5.1 that ships with Windows does not have it.
systeminfo. systeminfo | find "System Boot Time" prints the boot time. The label is localised, so on a non-English Windows the find string is different. systeminfo on its own is slow, because it also collects hotfixes and network cards.
Skip net statistics workstation. Its "Statistics since" line is when the Workstation service started. That is usually close to boot, but it is not boot, and old posts still recommend it.
Why does uptime keep counting after a shutdown?
Fast Startup. It is a Windows 10 and 11 client feature and it is on by default. Shut down logs the user off, then hibernates the kernel session to hiberfil.sys, and power-on resumes it. Uptime, LastBootUpTime and Task Manager all carry on counting from the last real boot.
Restart always performs a full boot, whether it comes from Start > Power > Restart, shutdown /r or Restart-Computer. Holding Shift while clicking Shut down also does a full shutdown.
Windows Server does not use Fast Startup, so uptime on a server means what it says.
To check whether it is on, run powercfg /a: Fast Startup appears among the available sleep states. The setting itself is HiberbootEnabled under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power, where 1 is on and 0 is off. powercfg /h off turns off hibernation, and Fast Startup goes with it.
Turning it off is a judgement call. Cold boots get a few seconds slower on a modern SSD, and in exchange a whole class of "I rebooted and it is still broken" calls goes away, because a shutdown becomes a real boot.
The same mechanism stalls Windows Update. An update that needs a reboot to finish stays pending on a machine that is only ever shut down. If restarting does not clear it, work through the fix order for a stuck Windows Update.
How do I find out who restarted it, or whether it crashed?
Uptime tells you when the machine booted. The System event log tells you why. These are the IDs worth knowing:
- 1074 (User32): a process or user started a restart or shutdown. It records the account, the program and the reason text, and Windows Update restarts show up here.
- 6005 / 6006 (EventLog): the event log service started or stopped cleanly. The pair brackets each boot.
- 6008 (EventLog): the previous shutdown was unexpected.
- 41 (Kernel-Power): the system rebooted without shutting down cleanly, from power loss, a hard hang or a bug check.
- 27 (Kernel-Boot): the boot type. 0x0 is a full cold boot, 0x1 is a Fast Startup (hybrid) boot and 0x2 is a resume from hibernation. This is the event that proves a Fast Startup case.
To pull the restarts and crashes in one go:
Get-WinEvent -FilterHashtable @{LogName='System'; Id=1074,6008,41} -MaxEvents 20 |
Format-Table TimeCreated, Id, Message -Wrap
How do I check uptime across a fleet?
Over WinRM (setup is in how to run PowerShell on a remote computer), this lists every machine in pcs.txt that has been up for more than 30 days, longest first:
Invoke-Command -ComputerName (Get-Content .\pcs.txt) -ScriptBlock {
$boot = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
[pscustomobject]@{ Boot = $boot; Days = [int]((Get-Date) - $boot).TotalDays }
} | Where-Object Days -gt 30 | Sort-Object Days -Descending |
Select-Object PSComputerName, Boot, Days
Invoke-Command adds PSComputerName to each result, so the output says which machine is which. The 30-day line is an example tied to a monthly patch cycle: a machine that has not restarted since the last Patch Tuesday has not finished installing it.
Pair the list with the pending reboot check. Long uptime plus a pending reboot flag is the machine to restart first.
How do I check uptime on Linux?
uptime -p prints something like "up 3 weeks, 2 days", uptime -s prints the boot time, and who -b prints the last system boot.
How does Moorfox show uptime?
Moorfox shows Uptime and Booted in the system section of every device page, read by the agent, so you see it without opening a session. The last boot time script can be saved as a command and run across a group, with the output collected per machine, which turns the fleet check above into one click and needs no WinRM.
Frequently asked questions
Does shutting down reset uptime on Windows 10 and 11?
Not with Fast Startup on, which is the default. Shut down hibernates the kernel and power-on resumes it, so uptime keeps counting. Restart, or Shift + Shut down, does a full boot and resets it.
What is the PowerShell command to check uptime?
(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime works in Windows PowerShell 5.1 and PowerShell 7. PowerShell 7 also has Get-Uptime, and Get-Uptime -Since returns the boot time.
How do I find out who restarted a Windows server?
Filter the System log for event 1074, which records the account, the process and the reason for every initiated restart or shutdown. Event 6008 or 41 instead means it went down without a clean shutdown.
Why do updates still say restart required when the PC is shut down every night?
Because with Fast Startup a shutdown is not a restart, so the reboot the update is waiting for never happens. Restart the machine once and the update completes.
How do I check if Fast Startup is enabled?
Run powercfg /a and look for Fast Startup in the list of available sleep states. The registry value HiberbootEnabled under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power is 1 when it is on and 0 when it is off.