Get-ADForest
Jump to navigation
Jump to search
$DomainName = (Get-ADDomain).DNSRoot $AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,isglobalcatalog,site,forest,operatingsystem $AllDCs = (Get-ADForest).GlobalCatalogs foreach ($dc in $AllDCs){ invoke-command $dc -ScriptBlock {hostname} }