Understanding when your machine was rebooted may assist you in troubleshooting better in case of any Abrupt shutdown or System Crash and in many other scenarios. You can achieve this with the following ways :
1. Use the Uptime utility in cmd prompt. Download it from this Link , extract and copy the uptime.exe to C:\Windows\System32 folder
CMD > type ‘uptime’ and hit Enter.
You can use \S Switch with uptime command to list all boot and shutdown events.
2. Go to Network Settings > Right click on the server NIC > Status .
You will see a clock running, this is clock gets reset every time machine reboots.
3. Use WMI query to know the last reboot time, Type in the below commmand in cmd Prompt.
Wmic os get lastbootuptime
4. Also, you can WMI query using Powershell with code below.
$wmio = Get-WmiObject win32_operatingsystem -ComputerName '127.0.0.1' $LocalTime = [management.managementDateTimeConverter]::ToDateTime($wmio.localdatetime) $LastBootUptime = [management.managementDateTimeConverter]::ToDateTime($wmio.lastbootuptime) $timespan = $localTime - $lastBootUptime $timespan
5. By using System Information Utility, type in the below command.
Systeminfo | find “System Boot Time”
Please note that, the string after Find in the ” ” (Double Quotes) is Case Sensitive
Net statistics workstation
7. Using the Task Manager, Right-click on the Taskbar, and click Task Manager. You can also click CTRL+SHIFT+ESC to get to the Task Manager.
In Task Manager, select the Performance tab > The current system uptime is shown under System.
8. An obviously you can use Event Viewer to find the Uptime and last reboot information, follow my article on this Link
Hope This was useful, please share if you are aware of any other way to know Uptime of a machine.
Happy Learning ! 🙂