Are you looking for the last reboot time on your Windows? You can easily find using PowerShell. In this detailed tutorial, you will learn how to get the last reboot time of your Windows computer using PowerShell.
There are multiple ways to retrieve the last reboot time in PowerShell. Here are a few useful ones.
- Using
Get-CimInstancewithWin32_OperatingSystemclass - Using
Get-WmiObjectwithWin32_OperatingSystemclass - Using system event logs
- Using
net statscommand output via PowerShell
Method 1: Using Get-CimInstance
The Get-CimInstance cmdlet is the modern and preferred way to query Windows Management Instrumentation (WMI) data. It is faster and uses newer APIs compared to Get-WmiObject.
You can use the Get-CimInstance PowerShell cmdlet to get the last reboot time.
Open PowerShell and run:
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LastBootUpTimeGet-CimInstancequeries theWin32_OperatingSystemWMI class.- The property
LastBootUpTimecontains the last reboot time in a WMI datetime format.
You can see the output below:
LastBootUpTime
--------------
24-11-2025 10:48:07Here is the exact output in the screenshot below:

The raw output is in WMI datetime format. To convert it to a standard readable format, use the below script:
(Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime |
ForEach-Object { [Management.ManagementDateTimeConverter]::ToDateTime($_) }Output:
Check out: Find SQL Server Instances using PowerShell
Method 2: Using Get-WmiObject
Get-WmiObject is the older cmdlet for WMI queries, still widely used for compatibility. Still you can use this cmdlet to get the last reboot time.
(Get-WmiObject -Class Win32_OperatingSystem).LastBootUpTime |
ForEach-Object { [Management.ManagementDateTimeConverter]::ToDateTime($_) }This produces the same output as Method 1 but is slightly slower and deprecated in newer PowerShell versions.
Here is the exact output in the screenshot below:

Method 3: Using System Event Logs
Windows logs system startup events in the event log. You can query the event log to find the last boot time.
Query the System Event Log:
Get-EventLog -LogName System -InstanceId 6005 -Newest 1 | Select-Object TimeGenerated- Event ID 6005 corresponds to the “Event log service started,” which typically happens at boot.
TimeGeneratedshows the timestamp of the event.
Output:
TimeGenerated
-------------
11/20/2025 12:00:05 PMNote:
- This method may not be as precise if the system has been running for a very long time or if event logs are cleared.
- For more detailed uptime, use the WMI methods above.
Read Enable BitLocker with PowerShell
Method 4: Using net stats workstation
You can also use the legacy command net stats workstation which displays statistics including the system uptime.
Run the command in PowerShell:
net stats workstation | Select-String "Statistics since"Output Example:
Statistics since 11/20/2025 12:00:00 PMThis date/time indicates when the system was last started.
Read Find OU of a Computer Using PowerShell
Find Last Reboot Time on Remote Computers
PowerShell allows querying remote machines, which is useful for system administrators managing multiple systems.
Using Get-CimInstance remotely:
$computerName = "RemotePC01"
Get-CimInstance -ComputerName $computerName -ClassName Win32_OperatingSystem |
Select-Object @{Name='LastBootUpTime';Expression={[Management.ManagementDateTimeConverter]::ToDateTime($_.LastBootUpTime)}}Note:
- You need appropriate permissions and firewall rules allowing WMI/CIM traffic.
- PowerShell Remoting (WinRM) must be enabled on the target machine.
Automate Last Reboot Reports for Multiple Computers
You can create a script to check multiple computers and export the results to CSV for reporting.
$computers = @("PC1", "PC2", "PC3")
$results = foreach ($comp in $computers) {
try {
$os = Get-CimInstance -ComputerName $comp -ClassName Win32_OperatingSystem -ErrorAction Stop
$bootTime = [Management.ManagementDateTimeConverter]::ToDateTime($os.LastBootUpTime)
[PSCustomObject]@{
ComputerName = $comp
LastBootUpTime = $bootTime
}
}
catch {
[PSCustomObject]@{
ComputerName = $comp
LastBootUpTime = "Error: $_"
}
}
}
$results | Export-Csv -Path "C:\Reports\LastBootTimes.csv" -NoTypeInformationConclusion
In this tutorial, I explained how to get the last reboot time using PowerShell using various methods.
Get-CimInstanceis the best and recommended method to retrieve the last reboot time on Windows systems using PowerShell. It is fast, reliable, and uses modern APIs.Get-WmiObjectprovides similar functionality but is deprecated and slower; use it only if compatibility with older PowerShell versions is required.- Querying system event logs (Event ID 6005) offers an alternative way to find the last boot time, useful for forensic or detailed event-based analysis.
- The
net stats workstationcommand is a quick legacy method but less flexible and harder to parse programmatically. - You can convert WMI datetime format to a standard readable date/time using
[Management.ManagementDateTimeConverter]::ToDateTime().
You may also like the following tutorials:
- RPC Server is Unavailable Error in PowerShell
- PowerShell Kill Process by Name
- Check Hard Drive Space using PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.