It’s always useful to quickly check you most important devices in your network! Especially to troubleshoot something.
A Script can help you to get things done faster. When search for common scripts like this I always find complicated and long scripts with built in extra’s. I like to keep my scripts simple for these situations.
First create a .txt file with a list of addresses or hostnames:
To accomplish this all I created the simple powershell script:
1 2 3 4 5 |
Get-Content Devices.txt | ` ForEach-Object { If (Test-Connection $_ -Count 1 -ErrorAction 0 -Quiet) { Write-Host "$_ is Pingable" -ForegroundColor Green } Else { Write-Host "$_ is DOWN" -ForegroundColor Red } } |
The Test-Connection cmdlet is used.
Let’s run the magic script and show what it looks like when it works.
Is it fast enough for you?
Leave A Comment