Get Primary, Secondary, Tertiary DNS values and more from Multiple Servers

Came across a unique request to get primary, secondary, and tertiary DNS values for multiple computers/servers across the domain. I started writing the script and got what I wanted.

Now this started off as just to query for DNS Server information, but then I thought to add other pieces to get myself a good Network Inventory of all the servers in the environment.

I am utilizing the Win32_NetworkAdapterConfiguration WMI Class to get the required information.

You can modify the script below to suit your needs. The complete list of settings that can be captured:

Since the scripts are querying for information it is best if it runs from a DC or a privileged server with an account that has privileged access.

To get the results you need the following two scripts:


I needed to get all the network information for all the domain controllers in the domain. So the following code retrieves it for me. This came really handy in viewing all the DNS settings setup on all the DCs and correcting them if needed.


This will get the information and export to an excel file that you can have handy for reference or auditing. Hope this helps!

Disable IPv6 on Windows Core Server 2008 R2 – 2012 R2

GUI Version:


  1. Open Control Panel > Network & Internet > Network & Sharing Center > Change Adapter Settings > Choose the Adapter
  2. Right Click – Select Properties
  3. Networking Tab
  4. DeSelect IPv6
  5. Close

No GUI… No problem (Core):

After doing the above procedure you might have to use the registry editor aswell to completely disable the ipv6 tunnel

Here’s what to do to disable IPv6 on Core Windows Server

First check the interface that you want to disable.


To completely disable IPv6 on a Windows Server 2008/2012-based computer yourself, follow these steps:

    1. Open Registry Editor.
    2. Locate the following registry subkey:
    3. In the details pane, click New, and then click DWORD (32-bit) Value.
    4. Type DisabledComponents, and then press ENTER.
    5. Double-click DisabledComponents, and then type 0xffffffff in Hexadecimal or 4294967295 in Decimal.Note The 0xffffffff value or the 4294967295 value disables all IPv6 components except for the IPv6 loopback interface.

      Also we can try this command to Disable IPv6 in Windows

    6. Reboot
    7. Re-run the above command to see if the interface shows IPv6 addresses