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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 06/28/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
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
Answered 06/29/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
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'.
Answered 06/29/2007 by: VBScab
Red Belt

Please log in to comment
0
Thanks dude!
Answered 06/29/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
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 ..
Answered 07/09/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity