Get-ADForest
Jump to navigation
Jump to search
Get your ad domain
$DomainName = (Get-ADDomain).DNSRoot
# Get all DC's
$AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,isglobalcatalog,site,forest,operatingsystem
Or
$AllDCs = (Get-ADForest).GlobalCatalogs