Friday, November 23, 2018

Gets a list of all of the domain controllers for all the domains within a forest.



$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ } | export-csv -path C:\Dclist.csv -NoTypeInformation