none
Use Powershell to read Conditional Forwarders with details? RRS feed

  • Question

  • We are an MSP with a primary network and 100's of conditional forwarders for the customer forests we support.  I am currently doing a rolling migration of our primary site Windows 2012R2 DC's to Windows 2016 DC.

    The majority of conditional forwarders were created a Active Directory integrated and are automatically published by the new Windows 2016 Domain Controllers. 

    But, there were many Conditional Forwarders created on our core DC's \ DNS servers that were not AD integrated.

    How can PowerShell read all DNS Conditional Forwarders with details so I can determine if they are AD integrated or manually created on that specific DNS server.  I can then used the reviewed data for creating the required conditional forwarders.

    Thanks, Stu

    Monday, April 24, 2017 5:39 PM

Answers

  • Hi Stu,

    >>How can PowerShell read all DNS Conditional Forwarders with details so I can determine if they are AD integrated or manually created on that specific DNS server.

    There are two ways:

    Invoke-Command -ComputerName ser1,ser2,ser3 -ScriptBlock{Get-DnsServerZone | ?{.ZoneType -eq 'Forwarder'} | fl * } -Credential $credential

    Or, using WMI:

    Invoke-Command -ComputerName ser1,ser2,ser3 -ScriptBlock{gwmi -Namespace root\MicrosoftDNS -Class MicrosoftDNS_Zone -Filter 'ZoneType = 4' | fl *} -credential $credential

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    • Edited by Hello_2018 Friday, April 28, 2017 6:56 AM
    • Proposed as answer by Hello_2018 Friday, May 5, 2017 9:52 AM
    • Marked as answer by Stuart Schifter Friday, May 5, 2017 3:51 PM
    Friday, April 28, 2017 6:54 AM