dns Archives » nexxai.dev https://nexxai.dev/category/dns/ reminders for my future self Mon, 11 Jul 2022 18:28:47 +0000 en-CA hourly 1 https://wordpress.org/?v=6.5.5 Get all of the conditional forwarders setup in an Active Directory domain https://nexxai.dev/get-all-of-the-conditional-forwarders-setup-in-an-active-directory-domain/?utm_source=rss&utm_medium=rss&utm_campaign=get-all-of-the-conditional-forwarders-setup-in-an-active-directory-domain https://nexxai.dev/get-all-of-the-conditional-forwarders-setup-in-an-active-directory-domain/#respond Mon, 11 Jul 2022 18:28:47 +0000 https://nexxai.dev/?p=311 The post Get all of the conditional forwarders setup in an Active Directory domain appeared first on nexxai.dev.

Just a quick post here as I found myself needing to find out what conditional forwarders each domain controller in an Active Directory domain had configured. We have nearly a hundred domain controllers and so going manually one-by-one was simply not an option. I whipped up this PowerShell script and figured that someone else out […]

]]>
The post Get all of the conditional forwarders setup in an Active Directory domain appeared first on nexxai.dev.

Just a quick post here as I found myself needing to find out what conditional forwarders each domain controller in an Active Directory domain had configured. We have nearly a hundred domain controllers and so going manually one-by-one was simply not an option.

I whipped up this PowerShell script and figured that someone else out there might need something similar. It is parallelized (the number of $instances can be changed to do more/less parallel work) and then just dumps it to a CSV-ish file.

$instances = 10

Get-AdDomainController -Filter * | ForEach-Object -ThrottleLimit $instances -Parallel {
    $dc = $_
    Write-Host $dc.Name
    $zones = Get-DnsServerZone -ComputerName $dc.Name | Where-Object {$_.ZoneType -eq "Forwarder" }
    $string = $dc.Name + ","
     ForEach ($zone in $zones) {
         $string = $string + $zone.ZoneName + ","
     }
    Write-Host $string
    $string | Out-File -FilePath ".\zones.txt" -Append 
}

There’s a lot of room for improvement here obviously, but it should at least get you going.

]]>
https://nexxai.dev/get-all-of-the-conditional-forwarders-setup-in-an-active-directory-domain/feed/ 0