Thanks for your script Allen! Altough I am not eager to try out something which isn't yet well tested. Also, as we are in a NT/2000/XP client environment a solution which could handle all those environments would benefit me a great deal.
Instead I am going for a netsh based solution:
My current netsh script
Code:
pushd interface ip
delete dns name=lo addr=all
delete wins name=lo addr=all
add dns name=lo addr=10.11.12.25 index=1
add dns name=lo addr=10.11.12.50 index=2
add wins name=lo addr=10.11.12.50 index=1
add wins name=lo addr=10.11.12.25 index=2
popd
The problem with the above is that despite the index values used above the result still is (part of ipconfig /all output):
Quote:
DNS Servers . . . . . . . . . . . : 10.11.12.25
10.11.12.50
Primary WINS Server . . . . . . . : 10.11.12.25
Secondary WINS Server . . . . . . : 10.11.12.50
They are in the same order as you can see. And I actually want 10.11.12.25 as the primary DNS and 10.11.12.50 as the primary WINS. Which I thought I did by adding the index values.. Hm..
Any suggestions fellas?