Renaming computer and Account in Windows 2000

Archived from groups: microsoft.public.win2000.setup_deployment (More info?)

Hi,

I have been trawling the net and ms site for a script which renames both the
computer account and the physical computer, the scenario is basically I have
about 200 users to join to our new domain which I am doing via a netdom
command running from login script, trouble is we want to rename the computers
to include a three digit prefix. Whether this is done before joining the
domain or after i'm not too fussed, before would be my preference however.

I have found a script to rename the computer account but not the computer!!
if I had XP apparently it wouldn't be a problem.

If anyone knows of such a tool or script to help me achieve this task
without physically touching each pc would be appreciated..

Thanks

Kevin
5 answers Last reply
More about renaming computer account windows 2000
  1. Archived from groups: microsoft.public.win2000.setup_deployment (More info?)

    Hi,

    The way I do it, is to rename the computer in the registry and then reboot
    it, but LOOK OUT. As soon as you rename it and reboot it, it might drop off
    the network completely unless you've got your DNS and/or WINS set up to cope
    with the changes.

    You have to make sure everything is done in the right order and that every
    related name is changed. DNS, WINS, Computer, Secure Channel.

    --
    Gerry Hickman
    SSRU SysAdmin

    "Kevin" <Kevin @discussions.microsoft.com> wrote in message
    news:75794C87-58D5-4934-A65A-AAFECB14C176@microsoft.com...
    > Hi,
    >
    > I have been trawling the net and ms site for a script which renames both
    the
    > computer account and the physical computer, the scenario is basically I
    have
    > about 200 users to join to our new domain which I am doing via a netdom
    > command running from login script, trouble is we want to rename the
    computers
    > to include a three digit prefix. Whether this is done before joining the
    > domain or after i'm not too fussed, before would be my preference however.
    >
    > I have found a script to rename the computer account but not the
    computer!!
    > if I had XP apparently it wouldn't be a problem.
    >
    > If anyone knows of such a tool or script to help me achieve this task
    > without physically touching each pc would be appreciated..
    >
    > Thanks
    >
    > Kevin
  2. Archived from groups: microsoft.public.win2000.setup_deployment (More info?)

    Hi Gerry,

    Thanks for your advice, hmm I hope it is that simple, so you are talking
    about this particular key:
    HKLM\system\currentcontrolset\control\computername\computername

    is that the only place you changed? have your workstations been behaving
    since? the Schannel and DNS etc. isnt a problem as I am going to execute this
    reg merge from a netware login script before they join AD... now, I just need
    to prefix the computername, unfortunately %computername% will not resolve
    here so any ideas how I just add the prefix to the existing name..

    Thanks

    Kevin


    "Gerry Hickman" wrote:

    > Hi,
    >
    > The way I do it, is to rename the computer in the registry and then reboot
    > it, but LOOK OUT. As soon as you rename it and reboot it, it might drop off
    > the network completely unless you've got your DNS and/or WINS set up to cope
    > with the changes.
    >
    > You have to make sure everything is done in the right order and that every
    > related name is changed. DNS, WINS, Computer, Secure Channel.
    >
    > --
    > Gerry Hickman
    > SSRU SysAdmin
    >
    > "Kevin" <Kevin @discussions.microsoft.com> wrote in message
    > news:75794C87-58D5-4934-A65A-AAFECB14C176@microsoft.com...
    > > Hi,
    > >
    > > I have been trawling the net and ms site for a script which renames both
    > the
    > > computer account and the physical computer, the scenario is basically I
    > have
    > > about 200 users to join to our new domain which I am doing via a netdom
    > > command running from login script, trouble is we want to rename the
    > computers
    > > to include a three digit prefix. Whether this is done before joining the
    > > domain or after i'm not too fussed, before would be my preference however.
    > >
    > > I have found a script to rename the computer account but not the
    > computer!!
    > > if I had XP apparently it wouldn't be a problem.
    > >
    > > If anyone knows of such a tool or script to help me achieve this task
    > > without physically touching each pc would be appreciated..
    > >
    > > Thanks
    > >
    > > Kevin
    >
    >
    >
  3. Archived from groups: microsoft.public.win2000.setup_deployment (More info?)

    Hi Kevin,

    > Thanks for your advice, hmm I hope it is that simple, so you are talking
    > about this particular key:
    > HKLM\system\currentcontrolset\control\computername\computername

    Kind of.

    > is that the only place you changed?

    No.

    > have your workstations been behaving
    > since?

    Perfect.

    > the Schannel and DNS etc. isnt a problem as I am going to execute this
    > reg merge from a netware login script before they join AD...

    Hmm, well I can't comment on that, a login script sounds a bit odd.

    > now, I just need
    > to prefix the computername, unfortunately %computername% will not resolve
    > here so any ideas how I just add the prefix to the existing name..

    Here's an example of my "rename" function. I unjoin the box from the
    domain with NetDom, reboot, adjust DNS and WINS, then run this script,
    reboot, then re-join the box with NetDom. Something like that anyway -
    it's been a while since I had to do it. I remember being able to
    automate the whole thing and ran it on dozens of machines.

    The function below can't be run without my custom JScript libraries, but
    it's very easy to see how it works, just use the conepts in your own
    scripts.

    BEWARE OF LINE WRAP!


    // ReanmeComputer.wsf
    function rename(strOldName, strNewName) {

    var strRegPath =
    "System\\CurrentControlSet\\Control\\ComputerName\\ComputerName";
    var strValueName = "ComputerName";
    var r = new Reg();
    r.connect(oLoc, strOldName);
    var strCurrentName = r.readString(r.HKLM, strRegPath, strValueName)
    if(!strCurrentName) {
    _trace("*** Problem Reading Registry ***");
    return false;
    }

    _trace(strOldName + " has the current NetBIOS name of " + strCurrentName);

    if(!r.writeString(r.HKLM, strRegPath, strValueName, strNewName)) {
    _trace("*** Problem writing Registry ***");
    return false;
    }

    _trace(strNewName + " written to NetBIOS name in registry");

    strRegPath = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters";
    strValueName = "NV Hostname";

    if(!r.writeString(r.HKLM, strRegPath, strValueName, strNewName)) {
    _trace("*** Problem writing Registry ***");
    return false;
    }

    _trace(strNewName + " written to to hostname in reg");

    r.dispose();

    return true;
    }


    --
    Gerry Hickman (London UK)
  4. Quote:
    Archived from groups: microsoft.public.win2000.setup_deployment (More info?)

    Hi,

    I have been trawling the net and ms site for a script which renames both the
    computer account and the physical computer, the scenario is basically I have
    about 200 users to join to our new domain which I am doing via a netdom
    command running from login script, trouble is we want to rename the computers
    to include a three digit prefix. Whether this is done before joining the
    domain or after i'm not too fussed, before would be my preference however.

    I have found a script to rename the computer account but not the computer!!
    if I had XP apparently it wouldn't be a problem.

    If anyone knows of such a tool or script to help me achieve this task
    without physically touching each pc would be appreciated..

    Thanks

    Kevin



    I was able to change the computer's name for my win2k pro by remotely logging in through DameWare, and clicking on Control panel > System> Network...(tab). That showed me the computer name and in there you can also set the domain name too. (Of course you need administrative privledges when you log in).
  5. I was able to change the computer's name for my win2k pro by remotely logging in through DameWare, and clicking on Control panel > System> Network...(tab). That showed me the computer name and in there you can also set the domain name too. (Of course you need administrative privledges when you log in).
Ask a new question

Read More

Computers Windows 2000 Windows