Jump to content

Computername change


Recommended Posts

Hi,

I am crea ting creating an unattended Windows 2003 + XP installation for a mid-range company (about a 300 pc's in the network).

Now you all know if all those PC's should get the same computername it won't work. That's why I'm searching for something to change the computername in the registry. I would create a little VS.NET tool to give in the computername when installation is finished. Then create .REG-keys with that computername in it. Than automatically add the reg keys to the registry if the user clicks on OK or something.

But my question is, is it possible to change the computername WITHOUT you have to reboot ? I've searched for the reg keys which have the computername.

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName: "GE-324PT0J-TEST"
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName: "GE-324PT0J"
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AltDefaultDomainName: "GE-324PT0J-TEST"
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AltDefaultDomainName: "GE-324PT0J"
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J-TEST"
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J"
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName\ComputerName: "GE-324PT0J-TEST"
HKLM\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName\ComputerName: "GE-324PT0J"
HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\NV Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\NV Hostname: "GE-324PT0J"
HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Hostname: "GE-324PT0J"
HKLM\SYSTEM\ControlSet002\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J-TEST"
HKLM\SYSTEM\ControlSet002\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J"
HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters\NV Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters\NV Hostname: "GE-324PT0J"
HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters\Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\ControlSet002\Services\Tcpip\Parameters\Hostname: "GE-324PT0J"
HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J-TEST"
HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName: "GE-324PT0J"
HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName: "GE-324PT0J-TEST"
HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName: "GE-324PT0J"
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname: "GE-324PT0J"
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname: "ge-324PT0J-TEST"
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname: "GE-324PT0J"
HHKU\S-1-5-21-2025429265-1957994488-1343024091-500\Volatile Environment\LOGONSERVER: "\\GE-324PT0J-TEST"
HKU\S-1-5-21-2025429265-1957994488-1343024091-500\Volatile Environment\LOGONSERVER: "\\GE-324PT0J"

The first keys are the ones it was original, the second key is the edited key. (so first it was "ge-324PT0J-TEST" and then it was "GE-324PT0J")

If I create a reg file with all those values in it (the new ones). And I add it to the registry, will the computername then be changed good and won't the computer reboot afterwards ?

ALSO I have a little question:

is it possible to do something with the IP-adress to ? So creating another tool (or in the same tool) and than give up the IP adress so that is fixed too ?

I can't test atm for all that stuff so hopefully somebody knows!

thanks in advance.

Jeroen.

EDIT:

After some searching I found this:

http://mystuff.clarke.co.nz/wsname.asp

this propably will be easyer than creating a tool by myself, will test it later today if I have some time and a pc to test :P

Edited by Jeroeneke
Link to comment
Share on other sites


What's it with that unattend.udb file ?

Yes, I know all the Computernames and ip-adresses ahead!

It's actually used in my school, and the ip-adresses ar sorted by class like this:

10.0.<class>.<pcnumber>

(for example: 10.0.206.11 (this means pc 11 in room 206)

The computernames are quite comon i thought (I should watch at school for it)

so can you please explain me bit more? thx!

jeroen.

Link to comment
Share on other sites

What's it with that unattend.udb file ?

Sorry, I didn't realize you are installing from CD - that way you can't use the unattand.udb file - it can only be used when you initiate the installation manually (for example booting to dos/bartpe/winpe and using winnt.exe).

But if you were installing from network distribution or started the installation manually via one of the methods, then you could use it. Simply put you add /udf parameter to winnt.exe command so it looks like:

winnt /unattend:z:\unattend.txt /udf:PC01,unattend.udb

when installing PC with the name PC01. z:\unattend.txt is the path to the answer file (just other name for winnt.sif) and unattend.udb is the Uniqness Database File - the values from it overwrite the values in the answer file. So let's illustrate on my little example - I have this unattend.udb file:

;SetupMgrTag

[UniqueIds]
PC-01=UserData
PC-02=UserData
PC-03=UserData
[PC-01:UserData]
ComputerName = PC-01
[PC-02:UserData]
ComputerName = PC-02
[PC-03:UserData]
ComputerName = PC-03

Now when I want to install PC with the name PC-03, I use this command:

winnt /unattend:z:\unattend.txt /udf:PC-03,unattend.udb

This way you can have as many predefined names as you want. You can ofcourse override other settings of the answer file in the .udb file, but just be warned that inserting Windows product key never worked for me this way (although it is supposed to).

Sorry for bit offtopic comment.

PS: I think you have to use winnt32.exe instead of winnt.exe when installing from WinPE (and I assume the same goes for BartPE).

Link to comment
Share on other sites

Another solution: Try this Novell utility for changing the workstation name of a Windows computer.

Zcnc Lite 1.3

It works very well. Does not require a reboot and can be run whenever you like. I have it run after everything else is finished with my UA install.

Edited by VCC
Link to comment
Share on other sites

Thank you so much gunsmokingman for those project files!

At school I have to program in VS.NET 2003 (for 2years now) but we don't see any useful things (in my eys)!

but your program is a good study object for me! Good to learn some things!

thanks man!

Will watch your codes! (Just downloaded VB.NET from the microsoft site, it seems to be free now :D)

EDIT: I just have a question, are you good in programming in VB.NET ? I'm searching for something for some months now, but I couldn't find, but I'm quite sure it should work! So maybe you could help me ? :P

lol, this is getting quite offtopic now :P

EDIT2: oh man this is so great, I've found what I've searched for, just be studying your code for some minutes! Thx man! :D

Edited by Jeroeneke
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...