I'm trying to figure out why "netsh dump" produces different scripts on 2003 versus 2008. In output below, I've used "netsh interface ip dump" to keep the length of this post reasonable. I've searched the full dump, and the DNS settings have not moved outside of the "interface ip" context.
Specifially why the 2008 dump does not include the DNS settings?
Also seems strange that the 2008 dump does not include a "gateway" setting on the "set address" command
Does the "nexthop" setting in the 2008 output replace the "gateway" setting of 2003?
It's easy enough to write your own script, if you want the same settings everywhere But I would like to use this to backup the config on servers with unusual NIC configs in different DMZ's where I'm not sure I completely trust some of the app owners who are administrators to not some day make their own NIC changes. So I'm not just looking for one config script that I create manually and run on hundreds of targets. It seems like NETSH DUMP should be able to produce a backup of the current NIC configuration on a specific server, and thats what I'm looking for.
I've searched the kb, and see there are numerous articles for issues with NETSH
The following two had hotfixes that I applied hoping there was some hidden overlap with my issue.
However I still have the problem after they have been applied
http://support.microsoft.com/kb/979101
http://support.microsoft.com/kb/2472264
Thanks
# ----------------------------------
# IPv4 Configuration from static 2008 R2 SP1
# ----------------------------------
pushd interface ipv4
reset
set global icmpredirects=enabled
add route prefix=0.0.0.0/0 interface="Local Area Connection" nexthop=10.9.8.7 publish=Yes
add address name="Local Area Connection" address=10.9.8.6 mask=255.255.255.0
popd
# End of IPv4 configuration
# ----------------------------------
# Interface IP Configuration from static 2003 Sp2
# ----------------------------------
pushd interface ip
# Interface IP Configuration for "Local Area Connection"
set address name="Local Area Connection" source=static addr=10.9.8.7 mask=255.255.255.0
set address name="Local Area Connection" gateway=10.9.8.6 gwmetric=0
set dns name="Local Area Connection" source=static addr=10.9.8.1 register=PRIMARY
add dns name="Local Area Connection" addr=10.9.8.2 index=2
popd
# End of interface IP configuration
Yeah, this is really unfortunate. I have no idea why Microsoft omits the DNS settings in
netsh dump
in 2008+.Unfortunately I think all you can do is split your process into two separate operations now... a
netsh dump
followed by anetsh interface ipv4 show dns
... Of course I realize that this defeats the purpose of exporting and importing the configuration in an automated way. You'll have to write something custom I'm afraid.It's not fixed in Win8/Server 2012 either. Microsoft is migrating away from netsh in general and going full Powershell, so don't hold your breath waiting for them to fix netsh.
Craig, not to hijack your question on how to get the information using netsh. I don't know why it would be different to be honest. Yes,
nexthop
is the same asgateway
, but that doesn't fully answer the question I guess.I Just didn't have room/formatting to place this as a comment, but maybe it will help you in your endeavor.
You could setup a Powershell script using WMI calls to get the info you need and back it up to a .csv or similar.
For instance you could use:
The dot (.) after -ComputerName is just for grabbing the local. You could create a small input file of computers/servers and do a "For Each" and get the output you desire.
An example output from my local computer is as follows: