July 20th, 2014

PowerTip: Use PowerShell to Display Last Boot Time

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to display last boot up time.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the last time a workstation booted up?

Hey, Scripting Guy! Answer Use the WMI Class Win32_OperatingSystem and select the LastBootupTime property.
          Using the Get-CimInstance cmdlet returns a properly formatted DateTime object, for example:

(Get-CimInstance Win32_operatingSystem).lastbootuptime

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback