When a Server was Last Rebooted
'Create a .txt and write down all your server name like...
Server1
Server2
Server3
Save the txt file in safe location like C:\temp\ServerProdQaDev.txt
Run the following PowerShell script and see the results when your server was rebooted.
FOREACH($svr in GC C:\temp\ServerProdQaDev.txt)
{Write-Host $svr “was rebooted on:”
$lastBootUpTime = Get-WmiObject Win32_OperatingSystem -ComputerName $svr | Select -ExpandProperty lastBootUpTime;
[System.Management.ManagementDateTimeConverter]::ToDateTime($LastBootUpTime);}'...
{Write-Host $svr “was rebooted on:”
$lastBootUpTime = Get-WmiObject Win32_OperatingSystem -ComputerName $svr | Select -ExpandProperty lastBootUpTime;
[System.Management.ManagementDateTimeConverter]::ToDateTime($LastBootUpTime);}'...
Trackbacks
Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.
Kommentare
Ansicht der Kommentare: Linear | Verschachtelt