Get Windows Last Reboot Timestamp?

powershell

Solution

You can do this via WMI:

$wmi = Get-WmiObject -Class Win32_OperatingSystem -Computer "RemoteMachine"
$wmi.ConvertToDateTime($wmi.LastBootUpTime)

Problem

I have a PC on remote connected by network, but it occasionally crashes or is restarted by remote users. After the restart, some services and applications have to be in running status. So I would like to find out the reboot as soon as possible. I think PS may be a good choice with some scripts so that I could make remote call to get the last reboot timestamp information. Is there any way to get a remote Windows XP last reboot timestamp by using PowerShell 2.0(its remoting feature)?

Original source