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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try this VBS
' From the book "Windows Server 2003 Networking Recipes"
' This code configures two WINS servers
strComputer = "."
strWins1 = ""
strWins2 = ""
' --------- 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."
    WScript.Echo "Error!! Unable to configure WINS servers."
  End If

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You could use PSExec in conjunction with NetSH.  However, you might want to just remove WINS and replace it with GNZ as follows:


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.