I need to turn on DHCP and Set the DNS Server Search Order on client in our network. I have the following script which will do it via VBScript. My question is can it be done in BES? if so How?
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “\root\cimv2”)
Set colNetAdapters = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE”)
I think your thinking more about relevance than actions. Relevance can’t modify anything, it only inspects. In an action the only other way to do it would be to modify the registry directly, or download a utility to do it. In my opinion, you have the right answer.
I threw my previous post together really fast, so I didn’t notice my error. Try this instead. You might be able to get away with using “localhost” since it’s executing on the local pc.
-Paul
delete __appendfile
appendfile strComputer = “.”
appendfile Set objWMIService = GetObject(“winmgmts:{{impersonationLevel=impersonate}!\localhost\root\cimv2”)
appendfile
appendfile Set colNetAdapters = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE”)
appendfile
appendfile For Each objNetAdapter In colNetAdapters
So can someone post the full action script to change a PC from static to DHCP and the relevance to go along with it? I have to move over a ton of PC’s to DHCP this weekend and was hoping to use BigFix to do that.
netsh interface ip set address “Local Area Connection” dhcp
and for dynamically obtaining DNS settings
netsh interface ip set dns “Local Area Connection” dhcp
So, just throw those in an ActionScript with waithidden in front? Your homework assignment would be A) make sure that command line works on the target OSes you are interested in, B) use relevance to only target boxes that are not set for DHCP, and C) test it out on a small number boxes first to make sure nothing goes wrong.