Skip to content

Commit

Permalink
Create Uptime-Checker.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rswio authored Jan 26, 2025
1 parent c3aaa1b commit d6ba98d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Monitoring/Uptime-Checker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$Servers = @("Server1", "Server2") # Replace with your servers
foreach ($Server in $Servers) {
$Uptime = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Server | Select-Object LastBootUpTime
Write-Output "$Server last rebooted on: $($Uptime.LastBootUpTime)."
}

0 comments on commit d6ba98d

Please sign in to comment.