Change WINS Server in all Machines
We have 2 WINS servers and we want to change one of them. How can I rewrite the logon script to make that change so that everyone that logs in will have that change made automatically?
Thanks --
Mike
Networks
We have 2 WINS servers and we want to change one of them. How can I rewrite the logon script to make that change so that everyone that logs in will have that change made automatically?
Thanks --
Mike
by mpart
VBScript sample. How do I get it to change WINS? My solution doesn't work:
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2" & WINSPrimaryServer & WINSSecondaryServer)
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
rem strIPAddress = Array("192.168.1.21")
rem strSubnetMask = Array("255.255.255.0")
rem strGateway = Array("192.168.1.1")
strWINSPrimaryServer = Array("172.31.41.25")
strWINSSecondaryServer = Array("172.30.30.25")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask, strWINSPrimaryServer,
strWINSSecondaryServer)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable = 0 Then
WScript.Echo "The Primary & Secondary WINS addresses has been changed."
Else
WScript.Echo "The WINS IP addressescould not be changed."
End If
Wscript.Echo "Primary WINS IP Address: " & objNetAdapter.WINSPrimaryServer
Next
by e.p.man
Not a direct answer to your question on the script, but another path for a solution that may be worth hearinig.
I would recomend tryinig to deploy a DHCP server solutioin if possible.
A DHCP (Dynamic Host Protocl) server allows your clients torecive automatic TCP/IP confiuration for basic and advanced TCP/IP settings (like address, subnet mask, defaukt gateway, DNS server, WINS server and so forth)
Using DHCP in your netework will make your life much easier by allowing you to change settings when needed on a center server and immediate changes on the end hosts.
If your network also needs static entriees for spcial clients you may reserve IP’s on the DHCP server and assigned them to specified clients and their MAC address.
Hope this helps
by mpart
by uch
by mpart
by mpart
This discussion is closed to new replies.
Sort by Trending