Short script to retrieve the latest reboot time(s) of a computer
Since Technet Gallery is closed, now here.
See Script Center version: Retrieve latest reboot time(s).
Now also on Powershell Gallery as part of the SysAdminsFriends module, see here or install with
Install-Module SysAdminsFriendsProject page on github is here.
This is a little helper script that is very useful in a work as system administrator:
In an enterprise you often have to log on to "unknown" servers that behave strangely. Getting the latest reboot time(s) is a very important information for further diagnosis (a well managed server normally reboots only once in a month on Microsoft Patch Day).
in the following examples I assume Get-RebootTime.ps1 is in the current directory
To use it just dot source the script Get-RebootTime.ps1 per instance by
. .\Get-RebootTime.ps1You can than get the latest reboot time of the local computer with
Get-RebootTimeFor investigating a remote computer REMOTE and the last three reboot times you call
Get-RebootTime REMOTE 3A dot can be used for the name of the local computer.
You will get a similiar output to this (screenshot is not from a bad managed server, but my personal computer):
