Script to return the DNS entries on servers listed in a text file
good day,
i'm looking script query dns entries on lan connection (primary , secondary) on various servers listed in text file , output results csv file.
any appreciated.
get-content c:\servers.txt | foreach { get-wmiobject win32_networkadapterconfiguration -computername $_ } | {$_.dnsserversearchorder} | select ` @{n="name";e={$_.__server}}, @{n="primary";e={$_.dnsserversearchorder[0]}}, @{n="secondary";e={$_.dnsserversearchorder[1]}}, description | export-csv -notype c:\result.txt
or download module - http://psnetadapterconfig.codeplex.com/
Windows Server > Windows PowerShell
Comments
Post a Comment