/build/static/layout/Breadcrumb_cap_w.png

Changing the values of TCP/IP interfaces

Morning All,

I have to come up with a way of setting the NameServer value under for following key.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{GUID}]
"NameServer"="10.110.x.x,10.110.x.x"

The problem being the GUID is unique to each interface and many of my machines have more than one NIC/interface. I can’t find a way to return the interface GUID and I'm not quite sure how to deal with the multiple NICs issue. It would be acceptable to change the NameServer value for all interfaces.

Any ideas? I’m stumped.

Charlie

0 Comments   [ + ] Show comments

Answers (5)

Posted by: jmcfadyen 13 years ago
5th Degree Black Belt
0
wmi will do the trick.

get a copy of Scriptomatic2 from Microsoft if your not familiar with WMI

i think the classes you need are

Win32_Network
Win32_NetworkAdapter

U can change ALL Tcpip settings with this.
Posted by: fuz_kitten 13 years ago
Second Degree Blue Belt
0
Thanks jmc - i just downloaded Scriptomatic, but i've never used it before and i dont understand I'm looking at. Any chance of some pointers Jmc?

Cheers
Charlie
Posted by: anonymous_9363 13 years ago
Red Belt
0
You don't really need Scriptomatic: it just makes using WMI easier. However, WMI is just like any other object: just 'connect' to it and use its propertiesd and methods. You will still be faced with WMI's obscure syntax whether or not you use Scriptomatic so, if it were me, I'd be Goggling for some examples. You could do worse than start here. About midway down is the section 'Networking'.
Posted by: fuz_kitten 13 years ago
Second Degree Blue Belt
0
Thanks dude!
Posted by: jmcfadyen 13 years ago
5th Degree Black Belt
0
scriptomatic as vbscab mentioned is just a tool to make life a little easier.

select the classes named in the post above.

it will then write a bunch of vbs code which can manipulate each of the settings which belong to the class.

cut and paste the bits you want to use.

alternatively theres some good detail on the real men dont click website ..
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ