There’s usually more than one way to do things in IT and getting the last boot time in Windows is no different.
Depending on OS Version, version of Powershell if installed, or if wmic is installed, will dictate the command to be used.
Resource: How to Tell if PowerShell is Installed
Below are four ways to get the last boot time on Windows. Two are via PowerShell and two via the Command Prompt.
The first Powershell command is for Powershell version 3.
Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime
This second command is for Powershell versions 1 and 2.
Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
The third command is for Windows 7 or later command prompt.
systeminfo | find /i "Boot Time"
This wmic command is the same that is called in the second Powershell above but is called natively at the command prompt. Wmic returns time in UTC.
wmic os get lastbootuptime