Identifying last restart time in W10/W11

Post Reply
Oscar
Posts: 3
Joined: 06. Jul 2023, 08:41
Contact:

Identifying last restart time in W10/W11

Post by Oscar » 26. Jul 2023, 18:25

Hello everyone,

Have you been successful in identifying the last reboot timestamp for a W10/W11 device via WMI (so that I can upload it to the inventory as a custom field)?

I'm looking everywhere on the internet and the only info points to LastBootUpTime which does not correspond to the restart of the device but actually something different (last boot up)

Queries like this:
[Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject win32_operatingsystem).LastBootUpTime)

or

systeminfo | find /i "Boot Time"

I can't believe something so simple cannot be identified in Windows!

Kind regards,
Oscar Llorens

G23
Posts: 79
Joined: 20. Jan 2021, 17:08
Contact:

Re: Identifying last restart time in W10/W11

Post by G23 » 02. Aug 2023, 13:04

You mean cmd: systeminfo, system boot time?

Did you try the Eventviewer Event ID Description
41 The system has rebooted without cleanly shutting down first.
1074 The system has been shutdown properly by a user or process.
1076 Follows after Event ID 6008 and means that the first user with shutdown privileges logged on to the server after an unexpected restart or shutdown and specified the cause.
6005 The Event Log service was started. Indicates the system startup.
6006 The Event Log service was stopped. Indicates the proper system shutdown.
6008 The previous system shutdown was unexpected.
6009 The operating system version detected at the system startup.
6013 The system uptime in seconds.

actually it would be really helpful to be able to see that information, most problems with rollouts happen because users won't restart their system

Post Reply

Return to “Inventory”

Who is online

Users browsing this forum: No registered users and 1 guest