How to know Last Boot uptime of servers


Hi All,

Below is the sample script for that. Run this in your local desktop.

$computers = "Server1",”Server2”

$os = Get-CimInstance Win32_operatingSystem -ComputerName $computers

$os | Select Caption,OSArchitecture,InstallDate,LastBootUpTime,@{Name="Uptime";Expression={(Get-Date)-$_.LastBootUpTime}},PSComputername

Regards,

Chaitanya

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free