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

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...