Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Get the Computer Uptime (Last Boot Time) on Windows

January 13, 2025 PowerShellQuestions and AnswersWindows 10Windows 11

Get the Computer Uptime (Last Boot Time) on Windows

There are several ways to find out how long Windows has been running (uptime) since the last boot.

You can use the Task Manager GUI to view the total Windows uptime.

  1. Open the Task Manager (run the taskmgr.exe command or press the Ctrl+Shift+Esc)
  2. Go to the Performance tab -> select CPU
  3. Check the Up time value view Windows uptime in task manager

You can also get the last boot time of the computer by using the command:

systeminfo

System Boot Time is the time Windows was last restarted (booted).

systeminfo - get system boot time

In this case, only the last boot time is displayed at the command prompt. To calculate the uptime value as the difference between the current time and the Windows boot time, use the following PowerShell commands:

$boot_time = Get-CimInstance Win32_OperatingSystem | select LastBootUpTime
(Get-Date) - $boot_time.LastBootUpTime | select Days,Hours,Minutes,Seconds

Get system uptime with PowerShell

The commands will return the computer’s uptime value in days and hours.

In the new PowerShell Core 6.x and 7.x versions, the new Get-Uptime cmdlet can be used to check the system uptime. This cmdlet returns the uptime value in days, hours, and minutes (in TimeSpan format). Or view the last Windows boot time

Get-Uptime -Since

Get-Uptime cmdlet in PowerShell Core 7.x

You can also use PowerShell to display a Windows’ last boot date/time and the name of the user who restarted the computer: How to check who shutdown or restart Windows?

You can get uptime from a remote computer:

$remotePC='hqpc12b23'
(Get-Date) - (Get-CimInstance Win32_OperatingSystem -ComputerName $remotePC).LastBootupT
ime

This command can be used to remotely query the uptime of multiple computers in an AD domain. The Get-ADComputer cmdlet is typically used to get a list of domain-joined computers.

Note that on desktops running Windows 10 and 11, the hybrid boot feature (Fast Startup) is enabled by default. In this mode, when the user turns off the computer, Windows does not power off the device, but instead unloads the kernel and drivers into a hibernation file. In this case (as well as after waking from sleep or hibernation), the computer’s uptime is not reset after it is powered on.

0 comment
0
Facebook Twitter Google + Pinterest
previous post
Enable Automatic System Registry Backup on Windows 10/11
next post
VPN Error 633: The modem is already in use or not configured

Related Reading

Unable to Map Drive: An extended error has...

May 13, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

How to Cancel Windows Update Pending Restart Loop

May 6, 2025

View Windows Update History with PowerShell (CMD)

April 30, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 21, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Run PowerShell Scripts on a Schedule with Task Scheduler
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • Extend an Expired User Password in Active Directory
  • Check Windows 11 Hardware Readiness with PowerShell Script
  • How to Enable and Configure Wake-on-LAN (WoL) in Windows
  • How to Find Windows Version and Build Number Installed
  • Check the Software Installation/Removal History in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top