Sorry we do not do that here. We can answer questions about scripting but you must learn how to write a script on your own.
Start here: https://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx?f=255&MSPPError=-2147217396
You can find pre-written scripts here: https://gallery.technet.microsoft.com/ScriptCenter/
You must be an admin on all servers or you must log in local (at the console) of all servers.
I am not clear please be specific "You must be an admin on all servers or you must log in local (at the console) of all servers"
I tried below script but it is t capturing advanced TCP/ip settings all list of DNS server address . it possaible to capture only preferred and alternative DNS server again how to change preferred and alternative DNS server via script I am for that script also
Get-Content .\servers.txt | `
ForEach-Object {
Get-WMIObject Win32_NetworkAdapterConfiguration -Computername $_ | `
Where-Object {$_.IPEnabled -match "True"} | `
Select-Object -property DNSHostName,@{N="DNSServerSearchOrder";
E={"$($_.DNSServerSearchOrder)"}},
@{N='IPAddress';E={$_.IPAddress}}
} | Export-CSV -path servers.csv -NoTypeInformation
Order is order. It is what you have in the results:
PS C:\scripts> $dns=Get-WMIObject Win32_NetworkAdapterConfiguration -filter 'ipenabled=true'|select -expand dnsserversearchorder PS C:\scripts> $dns[0] 75.75.75.75 PS C:\scripts> $dns[1]
75.75.76.76
You can easily go to the setting tab on the Network Adapter settings page. You can also read the documentation on the WMI class to learn how to use it.
Here are the docs: https://msdn.microsoft.com/en-us/library/aa394217%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
All of WMI and PowerShell are documented this way. When someone takes basic classes and training in Windows they learn how to look up things in the documentation. This is a must for anyone wanting to be a technician.
End users should stick to the GUI and ask questions here: http://answers.microsoft.com . This forum is not a help desk or an end user support forum. You are expected to know or be learning scripting and Windows technologies. If you have specific product questions then post in the associated product forum. In your case I would post in the networking forum. If you are trying to become a technician then read the link on the WMI class. All WMI classes are documented this way. Most of PowerShell is based on two things ... the Net Framework and ... WMI (CIM). Both are extensively documented on the Internet.