G
Gerry Hickman
I know this has been covered before, but did we ever get any good answers?
It seems in XP/2003 there are WMI calls you can make to do this, but
they don't work on Win2k. I don't know if this is due to lack of
underlying APIs (available remotely) or just lack of available classes
that can be called from scripting?
There's more to renaming a machine that just changing it's name. In an
ideal world the following will happen
"The machine talks to the DCs and adjusts it's computer account name and
keeps it's secure channel and retains domain admin permissions and no
reboot is needed".
However, in reality it seems the following has to happen:
1. The machine is "unjoined" from the domain, and it's computer account
gets deleted from the server, and this also means domain admin rights
are removed. (That can be a pain in itself as can't remote Admin the box
anymore!) A reboot is needed to complete the operation.
2. The local name of the machine gets changed
3. The machine has to be "rejoined" to the domain and rebooted again.
This could be tricky in script, as you no longer have domain admin
rights under which to run the script!
When using the GUI on the local box, however, you can do all this with
just one reboot; I'm not sure what order this happens in, does the name
get changed in the reg BEFORE the join attempt is made or after?
The only potentially scriptable tool I can find is NETDOM, part of the
"Support Tools", but despite having a "rename" option, it seems this is
ONLY for BDCs, not workstations! An other major problem with Netdom is
that you'd need to feed it plain text passwords, not good.
So to manually (but remotely) rename a machine you could (in theory)
1. Put the new name in the Reg, ready for reboot (not the active name)
2. Run Netdom (with the Reboot option) to unjoin it
3. Wait 60 seconds
4. Run Netdom again (with the Reboot option) to rejoin it
Obviously this is a joke, it's not even automated!
Surely admins on big networks have been doing this kind of thing with
NT4 for years?
There was an other poster suggested the following (no reboots?!?)
1. Rename the computer in the reg
2. Stop all the services
3. Start all the services
How on earth that will cope with domain membership, I have no idea; I'm
also not sure how you can start the services again (you won't have RPC
anymore). However, it's possible you could push a script to the local
box, run it there and then wait for it to complete, but that's starting
to get a bit over the top just to rename a computer.
It seems in XP/2003 there are WMI calls you can make to do this, but
they don't work on Win2k. I don't know if this is due to lack of
underlying APIs (available remotely) or just lack of available classes
that can be called from scripting?
There's more to renaming a machine that just changing it's name. In an
ideal world the following will happen
"The machine talks to the DCs and adjusts it's computer account name and
keeps it's secure channel and retains domain admin permissions and no
reboot is needed".
However, in reality it seems the following has to happen:
1. The machine is "unjoined" from the domain, and it's computer account
gets deleted from the server, and this also means domain admin rights
are removed. (That can be a pain in itself as can't remote Admin the box
anymore!) A reboot is needed to complete the operation.
2. The local name of the machine gets changed
3. The machine has to be "rejoined" to the domain and rebooted again.
This could be tricky in script, as you no longer have domain admin
rights under which to run the script!
When using the GUI on the local box, however, you can do all this with
just one reboot; I'm not sure what order this happens in, does the name
get changed in the reg BEFORE the join attempt is made or after?
The only potentially scriptable tool I can find is NETDOM, part of the
"Support Tools", but despite having a "rename" option, it seems this is
ONLY for BDCs, not workstations! An other major problem with Netdom is
that you'd need to feed it plain text passwords, not good.
So to manually (but remotely) rename a machine you could (in theory)
1. Put the new name in the Reg, ready for reboot (not the active name)
2. Run Netdom (with the Reboot option) to unjoin it
3. Wait 60 seconds
4. Run Netdom again (with the Reboot option) to rejoin it
Obviously this is a joke, it's not even automated!
Surely admins on big networks have been doing this kind of thing with
NT4 for years?
There was an other poster suggested the following (no reboots?!?)
1. Rename the computer in the reg
2. Stop all the services
3. Start all the services
How on earth that will cope with domain membership, I have no idea; I'm
also not sure how you can start the services again (you won't have RPC
anymore). However, it's possible you could push a script to the local
box, run it there and then wait for it to complete, but that's starting
to get a bit over the top just to rename a computer.