Sunday, 4 April 2021

Windows: Get last boot up time with PowerShell

To get the last boot up time using PowerShell, run the command:

Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LastBootUpTime

To get the last boot up time of a remote computer, run the command:

Invoke-Command -ComputerName HOSTNAME -ScriptBlock {Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LastBootUpTime}

No comments:

Post a Comment