Technical Article

When a Server was Lasr Rebooted

,

Create a .txt and write down all your server name like
Server1
Server2
Server3
Save the txt file in safe location. C: ServerProdQaDev.txt
Run the following PowerShell script and see the results when is your server was rebooted
FOREACH($svr in GC C:\ServerProdQaDev.txt)
{Write-Host $svr “was rebooted on:” 
$lastBootUpTime = Get-WmiObject Win32_OperatingSystem -ComputerName $svr | Select -ExpandProperty lastBootUpTime;
[System.Management.ManagementDateTimeConverter]::ToDateTime($LastBootUpTime);}

Rate

4 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

4 (1)

You rated this post out of 5. Change rating