I need a script so that I can change the network properties on each workstation. I need to change the DNS properties and WINS servers, I think it can do with vbscript. But i don't know how write. Could someone help me or guide me?
I need a script so that I can change the network properties on each workstation. I need to change the DNS properties and WINS servers, I think it can do with vbscript. But i don't know how write. Could someone help me or guide me?
As for the gateways, you can enumerate them (string DefaultIPGateway[]; property of the class), and set it with the SetGateways method of the same class. All good so far. The problem I found was that you were making the arrIPAddress array larger even if there was no new IP address for it to hold and it didn't like that.
On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetCards = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objNetCard in colNetCards Wscript.Echo objNetCard.SetDNSDomain("fabrikam.com") Next
I had tried manually with Netsh command to change default gateway setting in TCP/IP properties. Currently, if the link is down, user need to manually run this Netsh batch file to change default gateway. Using vbscript and Sysinternals PSEXEC you can run the NetSH on the remote machines.
After that their pc can switch to another default gateway. I think it will ok with vbscript for auto ping and change default gateway setting. I have the computer names and IP's in a text file. How can I loop psexec through the names to make the changes?? Anybody now the command? I had tried manually with Netsh command to change default gateway setting in TCP/IP properties.
Currently, if the link is down, user need to manually run this Netsh batch file to change default gateway. After that their pc can switch to another default gateway.
Bookmarks