Check computer uptime using PowerShell


Per il computer o server locale:

$Booted = (Get-WmiObject Win32_OperatingSystem).LastBootUpTime
[Management.ManagementDateTimeConverter]::ToDateTime($Booted)

Per un computer o server remoto:

$Computer = "nome_della_macchina"
$Booted = Get-WmiObject -Class Win32_OperatingSystem -Computer $Computer
$Booted.ConvertToDateTime($Booted.LastBootUpTime)