Renaming Computer 
Author Message
 Renaming Computer

I've seen some code on-line on renaming a computer, but
doing so will break the trust relationship if member of a

NETDOM has proven to be unreliable in joining domains
when I've previously renamed the computer. (the error
message is "the network address is invalid.") I can add
and remove workstations to the domain all day long, just
can't use the /JOINDOMAIN switch. I am using NT4 domains
no Win2k in mix. Using NETDOM 1.8.

Ideally I would like to programatically reproduce the My
Computer Properties Identification page where you can
change the computer name and domain in one fell swoop.

What is required when you rename a workstation and keep
the domain trust relationship valid? Some posts on just
changing some reg keys don't seem to be enough--does the
SID need to be regenerated?

My requirements:
1. delete the OLD computer name from the domain
2. rename the workstation and keep the current
relationship with domain intact. (this may involve adding
new computer and re-initializing trust relationship.
3. Ideally, new profiles should not be generated for
4. Only one reboot required

What language would work "best" for me here--and does
anyone have any code snippets to allow this to happen so
the user experience continues unchanged.

Please, any help (APIs to use, code snippets, general
approach, gotchas) is appreciated!

Sun, 26 Sep 2004 22:11:32 GMT  
 Renaming Computer
You positively can not rename a computer in the domain without taking it out
from the domain first. Deleting account from the domain wipes out any
relationships that domain had with computer.  Therefore you need to rejoin
domain after you rename your machine. Netdom serves the purpose well.
The major problem with your request is a single reboot. After you rename
machine, it needs to reboot before joining domain. Otherwise you need to
find  a mechanism to register NetBios name on the network without reboot.
There is a tool "baptize.exe" that renames PC and makes it available on the
network immediately. Download it here:
There is no code for the program, but it seems to work on NT machines.

My approach to the problem on the other hand would be to write a few lines
of code that can do this hands free:
1. break off domain, delete account.
2. change computer name in the registry.
3. reboot
4. join domain with new name (netdom) and reboot again.

Gurgen Alaverdian

> I've seen some code on-line on renaming a computer, but
> doing so will break the trust relationship if member of a
> domain.

Mon, 27 Sep 2004 01:34:16 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Shuting Down after Renaming Computer ...

2. Rename Computer in Domain

3. Renaming computer and workgroup

4. Windows 2000 Server - program to rename computer

5. Renaming Computer Workgroup using VB.

6. Renaming Computer Workgroup using VB.

7. Renaming Workstation Computer

8. WSH ideas regarding workgroup, computer renaming

9. Renaming a computer and workgroup by VBScript.

10. Renaming a file on computer

11. Computers from OU and then IP of those computers

12. Change my computer icon to show computer name.


Powered by phpBB® Forum Software