Powershell – Windows LastBootUptime ermitteln

System LastBootUptime per Powershell

$wmi=Get-WmiObject -computername worker -Class Win32_OperatingSystem
$wmi.converttodatetime($wmi.lastbootuptime)

((get-date) – (gcim Win32_OperatingSystem).LastBootUptime).ToString(‚g‘)

Get-WinEvent -ProviderName eventlog -Computername “Worker” | Where-Object {$_.Id -eq 6005} | Select-Object -First 1

# System LastBootUptime per CMD
systeminfo| find /i “Systemstartzeit:”

lastbootuptime