In Need of a WINS Script...

We have configured one of our servers with the role of a WINS server.  We want to configure all of the PC's in the company with the IP address of that server under the WINS tab of TCP/IP properties.  I am in need of a script that I can push out to those machines that will do this for me without having to touch each of them individually.  The address of that server is 10.1.1.60.
LVL 1
redvipergtsAsked:
Who is Participating?
 
tegmine_itConnect With a Mentor Commented:
Try this VBS
' From the book "Windows Server 2003 Networking Recipes"
 
' This code configures two WINS servers
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strWins1 = "192.168.1.151"
strWins2 = "192.168.1.152"
' --------- END CONFIGURATION ------
 
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set nics = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
 
For Each nic In nics
  intSetWINS = nic.SetWINSServer(strWINS1, strWINS2)
  If intSetWINSServer = 0 Then
    WScript.Echo "Success! WINS servers configured."
  ElseIf intSetWINSServer = 1 Then
    WScript.Echo "WINS servers configured, please reboot."
  Else
    WScript.Echo "Error!! Unable to configure WINS servers."
  End If
Next

Open in new window

0
 
sirbountyCommented:
0
 
RobSilverCommented:
You could use PSExec in conjunction with NetSH.  However, you might want to just remove WINS and replace it with GNZ as follows:

http://robsilver.org/misc/why-wins-will-be-here-for-some-time-or-not/

Regards,

Rob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.