PowerShell - Read-Host to out-grid DC TCP/ICMP Info w/IP address resolves
- Jon Boyette
- Jan 11, 2022
- 1 min read
Take the code and save as a named.ps1, it gets the DC's across the domain and asks for port to test, gives IP of DC's and Name, ping succeeds and tcp test succeeds reported per port
$a = Read-Host "Enter the Port For OutGrid View Across Domain"
# Get your ad domain
$DomainName = (Get-ADDomain).DNSRoot
# Get all DC's
$AllDCs = Get-ADDomainController -Filter * -Server $DomainName
# Using one-liner - Get all DC's and test connection on port 3269
(Get-ADDomainController -Filter * -Server $((Get-ADDomain).DNSRoot)).Hostname |
Foreach{Test-NetConnection -ComputerName $_ -Port $a -InformationLevel Detailed} |
Out-GridView -Title "Results"
Comments