Get-ADForest

From UVOO Tech Wiki
Revision as of 23:34, 10 June 2021 by Busk (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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} }