Changing Hostnames with Sysprep


Mario Lipinski


i am deploying Windows 2000 machines using Sysprep for image preparation
and Symantec Ghost Corp for the cloning process via network.
This works fine. There is only one problem: since i am using sysprep the
hostname gets reset in the "mini-setup". i now could configure sysprep to
prompt for the hostname. but i want it full-automated - so no
is there any way to change the hostname - maybe based on ghost variables,
dns reverse lookup, mac-address - hostname table - automatically using
the machines join a domain automatically so it would be best if if got
changed before sysprep joins the domain.

i found a tool "compname" on the internet which sets the hostname for
example by reverse dns. but there i expect problems with the domain

Any suggestions are welcome,

Thx in advance,

Mario Lipinski

Oli Restorick [MVP]

Hi Mario

I'm the author of compname and you're right, it will break domain
membership. Unfortunately, it's not possible to make compname run before
the automated domain join in the mini-setup wizard, either.

One option would be to leave the machine in a workgroup, run compname,
script a reboot and then use netdom from the Support Tools folder on your
Windows 2000 CD to script a domain join. If you use the cmdlines.txt
functionality, you have a built-in reboot anyway after running the command,
so you don't have to do any extra rebooting, except for the reboot required
after joining the domain with netdom.

It's not the prettiest method, but it's what I do for unattended setups.

Hope this helps


Stew Basterash


There is always more than one way to skin a cat... The best and least
expensive solution without relying on third party tools is to use sysprep
with a computer name of "*"... This will auto name your workstation during
sysprep... in addition, sysprep will also add your computer to the domain of
your choice... Now... the remaining thing to do is to rename the computer to
what you want, and move it from the "Computers" container and into the
proper OU... This can be done with a simple script written in VBScript or

If you need a solution for this and you do not have scripting expertise... I
will be happy to supply you with a solution... I will just have a few
environmental questions for you...

Stew Basterash

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question