Created
December 9, 2017 15:42
-
-
Save sub314xxl/e542930a2a4ac979fef794f0725f8341 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$servers = "dc1","dc3","sql1","wds1","ex1" | |
Foreach($s in $servers) | |
{ | |
if(!(Test-Connection -Cn $s -BufferSize 16 -Count 1 -ea 0 -quiet)) | |
{ | |
"Problem connecting to $s" | |
"Flushing DNS" | |
ipconfig /flushdns | out-null | |
"Registering DNS" | |
ipconfig /registerdns | out-null | |
"doing a NSLookup for $s" | |
nslookup $s | |
"Re-pinging $s" | |
if(!(Test-Connection -Cn $s -BufferSize 16 -Count 1 -ea 0 -quiet)) | |
{"Problem still exists in connecting to $s"} | |
ELSE {"Resolved problem connecting to $s"} #end if | |
} # end if | |
} # end foreach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment