+ Post New Thread
Results 1 to 9 of 9
Windows 7 Thread, Change computer name and re join domain script? in Technical; I looking for a way to take 28 computers that are on the domain, and rename them and re join ...
  1. #1

    Join Date
    May 2012
    Posts
    162
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Change computer name and re join domain script?

    I looking for a way to take 28 computers that are on the domain, and rename them and re join them to the domain.


    The reason is they have moved from 1 lab to another, and they should go from CSSLAB## to TEACHINGLAB##

    any idea?

  2. IDG Tech News
  3. #2
    tomgrindle's Avatar
    Join Date
    Oct 2010
    Location
    Gloucestershire
    Posts
    182
    Thank Post
    52
    Thanked 15 Times in 12 Posts
    Rep Power
    18
    I usually just log onto them as a domain admin ... Right click on My Computer, go to Properties and change the machine name in there and then reboot. Not sure how this would work though if a the name you want to give it already existed ... As long as its deleted out of AD, DHCP and DNS I presume it should be ok.

  4. #3
    tomgrindle's Avatar
    Join Date
    Oct 2010
    Location
    Gloucestershire
    Posts
    182
    Thank Post
    52
    Thanked 15 Times in 12 Posts
    Rep Power
    18
    I say already ... I mean used to obviously lol.

  5. #4

    Join Date
    May 2012
    Posts
    162
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    i really want to push a batch file or vbs through deep freeze on these machines and have it pop up with a windows "please enter computername" and you type in CSSLAB## (#=number 1,2,etc...) and then it joing the Rollins.edu domain.

  6. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13,908
    Blog Entries
    8
    Thank Post
    728
    Thanked 1,374 Times in 1,203 Posts
    Rep Power
    364
    Use netdom its built into windows. You just run it from one machine. I renamed 100 machines a few weeks ago in about 10 mins. Easy!

    Code:
    netdom renamecomputer oldname /newname:newcomputername /userd:DOMAIN\USER /passwordd:PASSWORD /usero:DOMAIN\USER /passwordo:PASSWORD /force /reboot:5
    You could also steal code from this: http://www.edugeek.net/blogs/fn-gm/1...-remotely.html

  7. #6


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    5,952
    Thank Post
    180
    Thanked 1,795 Times in 1,338 Posts
    Rep Power
    467
    Quote Originally Posted by FN-GM View Post
    Use netdom it's built into Windows
    Netdom isn't included with Windows 7.


  8. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    13,908
    Blog Entries
    8
    Thank Post
    728
    Thanked 1,374 Times in 1,203 Posts
    Rep Power
    364
    Quote Originally Posted by Arthur View Post
    Netdom isn't included with Windows 7.

    @Arthur It is on mine..... - see the attached.

    EDIT: i didnt notice you have made a link. It comes with RSAT.
    Attached Images Attached Images
    Last edited by FN-GM; 9th June 2012 at 03:16 PM.

  9. #8


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    5,952
    Thank Post
    180
    Thanked 1,795 Times in 1,338 Posts
    Rep Power
    467
    Quote Originally Posted by FN-GM View Post
    It is on mine.....
    Must be because you have RSAT installed.

  10. #9

    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    5
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Not sure if this will work 100% but its always worth a try. Let me know if this works??

    @echo off
    echo ****THIS WILL REJOIN YOUR PC TO DOMAIN*****
    echo
    echo If you do not get a PING response this will NOT work!
    pause
    set /p Comp=What is the Computer name?:
    ping %comp%
    :Respond
    set /p yn=Did you get a response [Y/N]?:
    if /I "%yn%"=="n" (GOTO Ping)
    if /I "%yn%"=="y" (GOTO Leave) else (GOTO Respond)
    :Leave
    set /p User=What is your username?:
    echo Leaving the domain...
    netdom.exe remove %comp% /domain:******* /userd:*****\%user% /passwordd:*
    :Leave2
    set /p yn=Did the above command process succesfully [Y/N]?:
    if /I "%yn%"=="n" (GOTO Lazy)
    if /I "%yn%"=="y" (GOTO Join) else (GOTO Leave2)
    :Join
    echo Rejoining the domain...
    netdom.exe join %comp% /domain:***** /userd:*******\%user% /passwordd:*
    :Join2
    set /p yn=Did the above command process succesfully [Y/N]?:
    if /I "%yn%"=="n" (GOTO Lazy)
    if /I "%yn%"=="y" (GOTO Restart1) else (GOTO Join2)
    :Restart1
    set /p yn=Do you want to restart [Y/N]?:
    if /I "%yn%"=="n" (GOTO END)
    if /I "%yn%"=="y" (GOTO Restart) else (Goto Response)
    shutdown -m \\%comp% -r -t 0
    :END
    exit
    :Restart
    shutdown -m \\%comp% -r -t 0
    GOTO END
    :Ping
    echo Will not work unless you get a response.
    pause
    GOTO END
    :Lazy
    echo Enjoy your walk to the machine!!
    GOTO END

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 6
    Last Post: 9th May 2011, 02:43 PM
  2. Replies: 7
    Last Post: 28th April 2011, 09:09 PM
  3. Cannot Change Computer Name
    By Techie101 in forum Windows
    Replies: 4
    Last Post: 27th April 2009, 04:58 PM
  4. Replies: 10
    Last Post: 3rd October 2007, 10:57 AM
  5. MAC Addresses and Computer Names
    By mattpant in forum Wireless Networks
    Replies: 4
    Last Post: 29th October 2005, 04:58 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •