Tuesday, 14 July 2015

When server was rebooted

Create a .txt and write down all your server name like
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;

No comments:

Post a Comment