In Need of a WINS Script...

Posted on 2008-11-18
Last Modified: 2012-05-05
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
Question by:redvipergts
    LVL 67

    Expert Comment

    LVL 5

    Accepted Solution

    Try this VBS
    ' From the book "Windows Server 2003 Networking Recipes"
    ' This code configures two WINS servers
    ' ------ SCRIPT CONFIGURATION ------
    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

    LVL 7

    Expert Comment

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



    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now