top of page

PowerShell - Read-Host to out-grid DC TCP/ICMP Info w/IP address resolves

  • Writer: Jon Boyette
    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"



 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page