A program you left running is gone, or Remote Desktop dropped your session: the first thing to check is whether Windows restarted. Windows writes down every start and every shutdown with its time and, for a planned restart, who or what asked for it. This guide shows how to read that record and how to tell a restart by a person, a restart for updates and a crash or power cut apart.

The examples use Windows Server 2025. Run the commands in PowerShell as Administrator: right-click the Start button and choose Terminal (Admin).


1. When Did Windows Start Last

(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
Tuesday, December 1, 2026 5:16:43 PM

Without a command: right-click the Start button, choose Task Manager, then Performance and CPU. Up time counts the days, hours, minutes and seconds since the start: 0:09:16:36 is 9 hours and 16 minutes.

2. The List of Starts and Shutdowns

This shows the last 12 entries about starting and stopping, newest first:

Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="User32","EventLog","Microsoft-Windows-Kernel-Power"; Id=41,1074,6005,6006,6008} -MaxEvents 12 | Sort-Object TimeCreated -Descending | Select-Object TimeCreated, Id, @{n="Source";e={$_.ProviderName}} | Format-Table -AutoSize
TimeCreated              Id Source
-----------              -- ------
12/1/2026 5:17:11 PM   6005 EventLog
12/1/2026 5:11:36 PM   6006 EventLog
12/1/2026 5:11:22 PM   1074 User32
12/1/2026 3:03:53 PM   6005 EventLog
12/1/2026 2:58:14 PM   6006 EventLog
12/1/2026 2:57:56 PM   1074 User32
11/27/2026 11:18:23 AM 6005 EventLog
11/27/2026 11:18:23 AM 6008 EventLog
11/27/2026 11:17:52 AM   41 Microsoft-Windows-Kernel-Power
11/26/2026 3:31:05 PM  6005 EventLog
11/26/2026 3:25:27 PM  6006 EventLog
11/26/2026 3:25:14 PM  1074 User32
IdWhat it means
1074A person or a program asked for a restart or a shutdown. Step 3 shows who.
6006Windows shut down properly.
6005Windows started.
6008After the start, Windows found that it had not been shut down properly.
41The same finding, written by another part of Windows and marked Critical.

Read the list from the bottom up. A normal restart is three lines: 1074, 6006 and, a few minutes later, 6005. In the example, the restart of December 1 began at 5:11 PM and Windows was back at 5:17 PM. A start with 6008 and 41 and without 1074 before it, like the one of November 27, means that Windows went down without a shutdown (step 4).

3. Restarts That Somebody Asked For

Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="User32"; Id=1074} -MaxEvents 5 | Select-Object TimeCreated, @{n="Type";e={$_.Properties[4].Value}}, @{n="User";e={$_.Properties[6].Value}}, @{n="Program";e={$_.Properties[0].Value}}, @{n="Reason";e={$_.Properties[2].Value}}, @{n="Comment";e={$_.Properties[5].Value}} | Format-List
TimeCreated : 11/26/2026 3:25:14 PM
Type        : restart
User        : SERVER01\Administrator
Program     : C:\WINDOWS\system32\shutdown.exe (SERVER01)
Reason      : Application: Maintenance (Planned)
Comment     : Monthly updates

TimeCreated : 11/26/2026 2:57:33 PM
Type        : restart
User        : SERVER01\Administrator
Program     : C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\StartMenuExperienceHost.exe (SERVER01)
Reason      : Other (Planned)
Comment     :
  • Type: restart, or power off or shutdown when the server was switched off.
  • User: the account that asked. A name such as SERVER01\Administrator is a person, or a program started by that person. NT AUTHORITY\SYSTEM is Windows itself, for example when it finishes installing updates.
  • Program: shutdown.exe is the shutdown command, typed by somebody or run by a script or an installer. StartMenuExperienceHost.exe is the power button in the Start menu.
  • Reason and Comment: what the person or the program stated.

For a restart by NT AUTHORITY\SYSTEM, compare its time with the updates that Windows installed: open Windows Update and choose Update history. See Windows Update on Windows Server.

💡 Leave a note for later

When you restart the server with a command, add the reason. It appears in this list as Reason and Comment, so you know months later why it happened. This restarts the server at once:

shutdown /r /t 0 /d p:4:1 /c "Monthly updates"

4. Shutdowns Nobody Asked For

Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="EventLog","Microsoft-Windows-Kernel-Power"; Id=41,6008} | Select-Object TimeCreated, Id, Message | Format-List
TimeCreated : 11/27/2026 11:17:52 AM
Id          : 41
Message     : The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.

TimeCreated : 11/27/2026 11:18:23 AM
Id          : 6008
Message     : The previous system shutdown at 11:08:13 AM on 11/27/2026 was unexpected.

Both entries are written at the next start. The time inside the 6008 message is the last moment at which Windows was known to be running, so the server went down then or a few minutes later. No events were found that match the specified selection criteria instead of a list means that there was no such shutdown.

There are three usual causes:

  • The server was restarted or switched off from outside Windows: with the Restart or Stop button of your service in the Client Area, or with the power controls of the remote management. Windows cannot tell this from a power cut. Check first whether it was you.
  • Windows crashed with a blue screen. The next command shows it.
  • The power was interrupted, or Windows stopped responding because of a hardware fault.

Look for a crash record:

Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="Microsoft-Windows-WER-SystemErrorReporting"; Id=1001}

No events were found that match the specified selection criteria means that Windows recorded no crash. If there is an entry, its message begins with The computer has rebooted from a bugcheck and names a code such as 0x0000009f. Send us this message when you open a ticket.

5. Is Windows Waiting for a Restart?

After some updates, Windows restarts by itself later, outside the active hours. This shows whether such a restart is waiting:

(New-Object -ComObject Microsoft.Update.SystemInfo).RebootRequired
False

True means that updates are installed and Windows will restart to finish them. Restart the server yourself at a time that suits you: How to Restart Windows Server.

6. What to Do

What you foundWhat to do
Windows restarts for updates at a bad timeSet the active hours, or install the updates and restart on a day you choose: Windows Update on Windows Server.
A restart by a user, and it was not youCheck who logged in and change the password: Who Logged In to Your Windows Server? Check Remote Desktop Logins and Failed Attempts.
Your programs are not running after a restartMake them start with Windows: Keep a Program Running on Windows Server.
One unexpected shutdown, and the server worksNothing, if you used the buttons in the Client Area at that time. Otherwise note the time and watch whether it happens again.
Unexpected shutdowns that repeat, or a crash recordOpen a support ticket with the times from step 4 and the crash message, so that we can check the hardware.

Good to Know

  • The same entries in a window: right-click the Start button and choose Event Viewer. Open Windows Logs > System, choose Filter Current Log... on the right, type 41,1074,6005,6006,6008 in the field that shows <All Event IDs> and choose OK.
  • How far back the list reaches: the System log has a fixed size, and the oldest entries are overwritten. This shows the date of the oldest one: (Get-WinEvent -LogName System -MaxEvents 1 -Oldest).TimeCreated
  • The times are times of the server. A new server may run on UTC: Set the Time Zone on Windows Server and Check That the Clock Is Right.
  • First steps on a new server: Windows Server: Quick Start Guide.
Was this answer helpful? 0 Users Found This Useful (0 Votes)