Archive - Check DC TCP ports from Client
Check DC open porst from client
1
2
3
4
5
6
7
8
9
10
11
12
13
$dcs = "servername", "servername2", "servername3"
$ports = "464", "389", "636", "3268", "3269", "53", "88", "49152", "135", "139", "445"
ForEach ($dc in $dcs) {
Foreach ($port in $ports) {
$Test = (Test-NetConnection $dc -port $port)
if ($Test.TcpTestSucceeded -ne $True) {
Write-Host "$dc $port Failed" -ForegroundColor Red
}
else {
Write-Host "$dc $port OK" -ForegroundColor Green
}
}
}
This post is licensed under CC BY 4.0 by the author.