force DHCP clients to use different WINS servers

Posted on 2007-07-25
Last Modified: 2007-12-19
Hi all,
we are in the process of adding two new WINS servers in our network. right now all clients are configured with DHCP to use the two existing WINS servers, and would like to find a way to force all workstations to start using the new ones without having to wait for the lease duration to expire, which is 2 months.

is there some sort of a script or a ustility that I can use to perform this task?

I appreciate all comments.

Question by:Medquest
    LVL 82

    Assisted Solution

    Assign a startup(!) script to the clients (this will interrupt network traffic during logon, so try this on a test machine in a test OU first).
    The script will check if it sees your new WINS server (replace the with the actual IP address) in the IP config, and if not, will do a renew; the results will be written to the log file specified.

    @echo off
    set NewWINS=
    set LogFile=C:\Windows\Temp\DHCPRenew.log
    ipconfig /all | find /i "%NewWINS%"
    if errorlevel 1 (
      >>"%LogFile%" echo %Date% %Time% New WINS server not found on this system, refreshing IP configuration ...
      ipconfig /release >>"%LogFile%"
      ipconfig /renew >>"%LogFile%"

    Author Comment

    this is a good solution if we were going to reboot the computers, but we're looking for a way of doing it without rebooting, and it was  my bad that I didn't mention that in my original post.

    I do appreciate your comment though.

    LVL 13

    Accepted Solution

    I'm assuming your using W2K3 or W2K Server as your DHCP server.  Go into your DHCP scope options and change your WINS servers to your new ones.  Then open the DCHP scope and choose the DHCP leases. Delete all the leases that are in there.  Next I would ask that all the clients restart their computers just to make sure they request a new IP address and don't have any problems.  The easiest thing to do would be to have everyone shut down there computers at night.  Then you can make the change and when the computers are powered up in the morning they'll have the new WINS servers.  As a rule of thumb I would recommend you change the lease duration to 4 days, just to help mitigate problems.  You can change the lease duration by opening the properties of the DHCP scope.  

    Alternative Solution (although it is not guaranteed):  If there are some computers that you can't restart, open the properties of the DHCP scope.  Change the lease duration of the clients to 30 minutes.  This could force all the workstations to update their IP information sooner.  I'm not sure this solution will work real well though since the clients already have a lease duration that may not be set to expire for a while.  
    LVL 13

    Expert Comment

    I just read that you're not going to reboot the computers.  Perform the steps mentioned in the first paragraph above without restarting the computers and it should still work.  Although the client computers may have some brief network connectivity problems while they obtain new IP address info.  It would be best if the users were at least logged off the computers when you did this.  

    Author Comment

    if I would go ahead and delete all the leases, some client machines will continue using the IP Addresses, and some other will obtain what theu think is a new IP Address, and we'll start getting all kind of dublicate IP Address exist on the network.

    the other thing is that we have more than 2800 machines and we normally tell users to logoff and leave the computer powered for windows updates, and if we'll reboot any computer it will get the new config, but it's not easy to reboot that many computers for this reason.

    we have planned on changing the lease duration to a month, but it was never approved until now.

    thanks for the comment.
    LVL 13

    Expert Comment

    Sorry for the bad information regarding deleting the DHCP Leases.  I wasn't even thinking about the duplicate IP address problem.  
    There are only two ways that I'm aware of to force DHCP client computers will renew their leases automatically:
    " Wait until half of the allotted lease time expires. The clients will then renew their leases automatically.  
    " Force a DHCP client to renew its lease by doing an ipconfig /release and ipconfig /renew
    I beleive you are going to be forced to temporarily change the lease duration, see if it works and then change it back to one month.

    Someone else may be able script something for you.

    Author Comment

    it's ok, right now I am defraging exchange databses, and doing some research and I think I found couple scripts on that may do the trick but I am testing them now and if they work I will post them here for everybody.


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
    Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    734 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

    21 Experts available now in Live!

    Get 1:1 Help Now