1 Reply Latest reply on Jul 15, 2014 7:56 AM by schepp

    Need a script to collect DNS and NTP info in large environment

    bklynjae Enthusiast

      Hi All,

       

      Im pretty new to Powershell scripts and would like some help if possible. I have a medium to large environment and would like to collect all the DNS and NTP info from all the hosts and export to a csv. Any help would be greatly appreciated.

       

      Thank you,

        • 1. Re: Need a script to collect DNS and NTP info in large environment
          schepp Virtuoso
          User ModeratorsvExpert

          Hey,

           

          I'm pretty sure LucD will come around the corner shortly with a Get-View Script that is much faster ;-) , but this works quick & dirty:

           

          Get-vmhost | Get-VMHostNetwork | Select VMHost, @{N="DNS Server";E={$_.DnsAddress -join " & "}}, @{N="NTP-Server";E={ Get-VMHost $_.VMHost | Get-VMHostNtpServer}} | Export-CSV C:\Temp\Dns-Ntp.csv

           

          You might need to add the join to the NTP Server as well when you have multiple assigned.

           

          Tim