This script will export a list of all Site and Subnets and the domain controllers in them.
[cmdletbinding()] param() $Sites = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites $obj = @() foreach ($Site in $Sites) { $obj += New-Object -Type PSObject -Property ( @{ "SiteName" = $site.Name "SubNets" = $site.Subnets -Join ";" "Servers" = $Site.Servers -Join ";" } ) } $obj | Export-Csv 'C:\sites.csv' -NoType




