Gather DNS settings from remote servers using PowerShell

This script is a continuation of the script in the “Performing Advanced Server Management” chapter in theWindows PowerShell 2.0 Bible., which itself was a modified version of a script I presented on my blog on May 12th, 2010: PowerShell WMI Gather DNS settings for all ServersThis

4.3 Star
26,544 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Great script, works like a charm
    1 Posts | Last post August 08, 2016
    • Thank you!
      Tested on Win10 and WS2012R2 
  • help with syntax for adding file Servers.txt.
    1 Posts | Last post December 09, 2015
    • Hi, I'd like help with adding a few modifications to this script. 
      1. adding syntax to gather DNS settings on all servers from text file
      2. if possible pipe output results to csv. 
  • Thank you!
    2 Posts | Last post December 02, 2015
    • You've saved me a lot of time. Just wanted to say a big thanks! The script on your blog is out of date I think, but this one works a treat! Still get a few errors but suspect it's from one of the servers with permission issues as I don't get a full set of data from that one.
    • I am glad you found this helpful.
  • Script reports Several of my Hyper-V machines have multiple NICs
    3 Posts | Last post November 27, 2013
    • Instead of the 1 "I see".  What would be the cause of this? The highest is 8 - 7 of which are duplicates.
    • Not answering but looking for a way to remove all the "duplicates" in Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'"
      Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled = 'True'"
      I think the "duplicates" come about when a Hyper-V machines has been moved several times and these duplicates are the old virtual NICs as I see expired DHCP data in all the NICs except the "current" one.  Odd this garbage is kept by the system.
    • Answering own question again.  This is a Windows XP "problem".  There are some scripts on the web when used with devcon.exe that all you to remove these "ghost" NICs.  Solving my own problem now..
  • Thnx very much!
    1 Posts | Last post November 14, 2013
    • Great script, works like a charm and saved me from a lot of work...;-)
      Thanks a lot!!
  • Using input and export files
    2 Posts | Last post September 13, 2013
    • Karl,
           I'm loving this script.  I have used it to gather info from specific servers a number of times.  I'm now facing a project where I need to gather this info (specifically DNS server settings) for several hundred servers.  Can you tell me how to use this script with an input file and how to output the full results to a file?
    • Karl,
           I apologize for not reading the header notes thoroughly.  I see how to pull in data from a list.  I will tinker around with exporting to a file.  Thanks again for the awesome script!
  • Using a serverList.txt file
    1 Posts | Last post August 01, 2013
    • I seem to be running into an issue with referencing a serverList text file - I cannot get the script to function... Exactly where do I call the serverlist file in the script?
  • Awesome!
    2 Posts | Last post May 07, 2013
    • Works a charm!
      Gathered DNS from Windows 2000 even
    • I am glad that you find this useful :)
  • Helpful !
    2 Posts | Last post May 07, 2013
    • Thanks Karl ! Works great.
    • You are welcome - glad to hear it!