static IP to dhcp

Discussion in 'Hardware' started by tbird1997, Mar 2, 2006.

  1. tbird1997

    tbird1997 Private E-2

    Hey guy’s,

    Looking for some advice on the best way of changing about 200 workstations across the country, from using static IP to using DHCP. I know there is a way using group policy, but I’m not sure. :confused:

    Thanks,

    John
     
  2. dedub

    dedub Corporal

    Do you have control of these computers? Are they logging into a D.C. that you administer? If so you can run a start-up script or change the GP for all users.
     
  3. tbird1997

    tbird1997 Private E-2

    Yes they are logging into a DC, but my boss wants to change 20 or thirty at a time, to make sure there aren't any problems. Is there a way of doing that amount daily automatically without me having to manually hit each machine?

    Thanks,
     
  4. skoku

    skoku Private E-2

    there are several ways to do this
    I'm using a little (free) software - dhcpset.exe, and psexec from sysinternals.
    in 2 hours i can change about 2000 workstations ;)
    you can also copy this soft into (all) workstations and run using loginscript.

    i can send you this .exe file and my batch script if you want.

    rdgs
    Skoku
     
  5. tbird1997

    tbird1997 Private E-2

    Skoku,

    Now that sounds like a great idea. It seems that I'll have a little control that way, and it looks like I'll have other locations that I'll have to move over in the future.
    Sending the .exe and the Batch script would really help.

    Thanks,

    John
     
  6. cat5e

    cat5e MajorGeek

    If I was in your position I would follow the Boss or would ask for a consultant.

    If you are in a state that you need an advice from a public forum for a business related Network you are risking you own Job.

    :)
     
  7. skoku

    skoku Private E-2

    you can also use netsh command
    or regedit ;)
    and put this into script.

    i don't have my script at home but you can use this:

    what do you need is psexec, dhcpset and text file with workstations names (ex. workstations.txt)
    copy all files into one folder and try this command
    for /f %i in (workstations.txt) do psexec -c \\%i dhcpset.exe

    but in this case you don't have controll which computer is down, on which you don't have admin rights.

    look there:
    http://www.jsifaq.com/SUBQ/tip8000/rh8017.htm
     
  8. tbird1997

    tbird1997 Private E-2

    Thanks for your help. I came across this script that I dropped on the workstations and then ran.

    REM Start Script

    if not exist c:\dhcp.txt goto end

    netsh interface ip set address "Local Area Connection" dhcp > c:\dhcp.txt
    netsh interface ip set DNS "Local Area Connection" dhcp
    netsh interface ip set WINS "Local Area Connection" dhcp

    netsh interface ip set address "Local Area Connection 2" dhcp
    netsh interface ip set DNS "Local Area Connection 2" dhcp
    netsh interface ip set WINS "Local Area Connection 2" dhcp


    :end

    REM End script



    The first line combined with the piping in the first netsh command ensures
    that the script will only run once, making subsequent logins faster. If you
    need to make the script run again for some reason, just delete the dhcp.txt
    file on the users c: drive.
    This will change the first 2 LAN adaptors to use DHCP. I really only needed
    to hit the first adaptor but the script will handle up to 2. If you have more than
    that, just add additional lines to the script. Any that don't exist just
    error then continue on, but as it's running as a startup script the user
    never sees the error.
     
  9. skoku

    skoku Private E-2

    you can also use netsh in this way:

    netsh exec script.txt >> control.txt


    script.txt

    interface
    ip
    set address "Local Area Connection" dhcp > c:\dhcp.txt
    set DNS "Local Area Connection" dhcp
    set WINS "Local Area Connection" dhcp
    set address "Local Area Connection 2" dhcp
    set DNS "Local Area Connection 2" dhcp
    set WINS "Local Area Connection 2" dhcp
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds