Knowing how long a Windows Server has been running tells you when it last restarted — useful for confirming a reboot completed, checking patch compliance, or investigating whether an unexpected restart occurred. Here is every way to check server uptime on Windows.
PowerShell — Most Accurate Method
(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
This returns uptime as days, hours, minutes, and seconds. For a cleaner formatted output:
$boot = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
$uptime = (Get-Date) - $boot
"Last boot: $($boot.ToString('dd MMM yyyy HH:mm:ss')) Uptime: $($uptime.Days)d $($uptime.Hours)h $($uptime.Minutes)m"
Check Uptime on a Remote Server
$boot = (Get-CimInstance -ComputerName SERVERNAME Win32_OperatingSystem).LastBootUpTime
(Get-Date) - $boot
Replace SERVERNAME with the server name or IP address. This works without logging into the server directly.
Command Prompt — systeminfo
systeminfo | findstr "System Boot Time"
Returns the exact date and time the server last booted, e.g. System Boot Time: 01/04/2026, 07:23:15. The full systeminfo command also shows OS version, installed RAM, and other useful details.
Command Prompt — net statistics
net statistics workstation | findstr "since"
Shows when the Workstation service started — usually within seconds of boot, making it a reliable proxy for system uptime. Slightly less precise than systeminfo for exact boot time.
Task Manager
Open Task Manager → Performance tab → CPU. The Up time field at the bottom shows days, hours, minutes, and seconds since the last boot. Quick for a local check but does not work for remote servers.
Event Viewer — Confirm the Last Restart
To see not just the uptime but also the reason for the last restart:
- Open Event Viewer → Windows Logs → System
- Filter for Event ID 6005 — “The Event log service was started” — this appears at every boot
- Also check Event ID 6006 — “The Event log service was stopped” — this appears at normal shutdown
- Event ID 6008 — “The previous system shutdown was unexpected” — confirms the server crashed or lost power rather than shutting down cleanly
- Event ID 41 (Kernel-Power) — “The system has rebooted without cleanly shutting down first” — confirms an unexpected restart
Check Uptime Across Multiple Servers
For environments with multiple servers, check uptime across all of them at once:
$servers = @("SERVER1", "SERVER2", "SERVER3")
foreach ($server in $servers) {
$boot = (Get-CimInstance -ComputerName $server Win32_OperatingSystem -ErrorAction SilentlyContinue).LastBootUpTime
if ($boot) {
$uptime = (Get-Date) - $boot
[PSCustomObject]@{
Server = $server
LastBoot = $boot.ToString('dd MMM yyyy HH:mm')
Uptime = "$($uptime.Days)d $($uptime.Hours)h"
}
}
} | Format-Table -AutoSize
What Uptime Tells You
- Uptime of hours after a scheduled patching window: confirms the server rebooted for patches as expected
- Unexpected short uptime: the server restarted without your knowledge — check Event Viewer for the cause
- Very long uptime (months or years): the server has not been patched or maintained — security patches require reboots and outstanding updates may be critical