We help IT Professionals succeed at work.

Change NT4 workstation computer name from script?

kb5yzi
kb5yzi asked
on
Is it possible to automatically change computer name from a script for a NT 4 Workstation? I am currently using netdom(RK) to move the machine accounts from one resource domain to another. I really would like a way to change the computer name at the same time I move the machine account.

Thanks!


Comment
Watch Question

Commented:
the name of the computer is stored in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName

using regedit, change the name to what you want, and export this key to a .reg file, say "sysname.reg"

you will need to create a seperate .reg file for each system, you can use the same system to create them, just keep changing the value and exporting the file.

then from your script call

regedit /s sysname.reg

to import the key.

Mike

Commented:
a suggestion:


if exists c:\temp\renamed.tmp goto renamed
rem... not renamed yet
regedit /s \\server\share\newnames\%computername%.reg
echo sldkflskd > c:\temp\renamed.tmp
shutdown.exe /reboot
exit
rem..system now renamed
:renamed
NETDOM /Domain:MYDOMAIN /user:adminuser password:apassword  MEMBER %computername% /JOINDOMAIN
exit



here you could use the old computer names to name the .reg files, that way a single script could work for all systems!

Of course it would have to be a local script..but you could use a login script to distribute the scripts before you start the whole process.

Good luck

Mike


Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20192304.html




PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Force-accepted by
Netminder
CS Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.