Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


zwirwel

WinXP/sysprep - script computer name change THEN join domain

Recommended Posts

Hi,

I'm in a real fix here trying to set up a computer lab. :blink:

Configuration:

I use Windows Server 2003 SP2 and Windows Deployment Services, but this issue would be similar with other imaging tools I imagine. Both capturing and deploying works fine, no problem there.

5 classrooms, 40 computers, all Windows XP SP2 with Volume Licence.

Situation:

I need to be able to change the computers name to a value that is specified in the computers "assettag" in the BIOS.

I can currently accomplish this using either a vbs script or wsname and both work (see attachment).

I can also script a join to a domain using netdom join. Standalone, this works just fine :thumbup: when I run them individually outside of sysprep.

I need this to be totally automated so that after WDS has deployed the image to the machine it will boot up and then automatically name itself and join the domain and automatically login (hopefully) and present the desktop. This is a closed off network so its not a problem that the computers automatically login and stand ready. The login name is the same as the computer name.

The problem is:

This is the procedure I have used so far:

- I build a clean Windows XP install and configure it. Then I setup c:\sysprep and copy the necessary files to it.

- I used the systemfile tool to build an unattend file sysprep.inf (see attachment) and put in the same folder.

- I have a script "prep.cmd" that is supposed to run and do this: add runonce line to make computer run netdom after reboot then run asset2pc.vbs and get computer name from assettag and then reboot the computer to set it and reboot

- after reboot, the computer goes to windows welcome screen and stops. I have to click to make it login, when it runs the netdom script and joins the computer to the domain using %computername% as variable for computer name and reboot

But the problem is I cannot figure out how to make the computer automatically login and run synchronously first the asset2pc script+reboot - autologin - netdom join+reboot - autologin as correct user

Where do I need to put what? Any ideas? Really desperate now...

mytools.zip

my_sysprep_inf.txt

Share this post


Link to post
Share on other sites

sounds like your almost there with this!

Basically, a simple way to do this (but maybe not the neatest way) would be to put a shortcut in the admins startup folder to a script that is in your image. If this script did the rename of your pc, deleted the shortcut to itself and copied in a new shortcut to the admin startup for another ascript which did the next phase and so on untill you have reached the end result.

To do this you would have to specify admin auto logon in the sysprep.inf

I think thats about it.

Good Luck

Share this post


Link to post
Share on other sites
sounds like your almost there with this!

Basically, a simple way to do this (but maybe not the neatest way) would be to put a shortcut in the admins startup folder to a script that is in your image. If this script did the rename of your pc, deleted the shortcut to itself and copied in a new shortcut to the admin startup for another ascript which did the next phase and so on untill you have reached the end result.

To do this you would have to specify admin auto logon in the sysprep.inf

I think thats about it.

Good Luck

That's what I ended up doing. Unfortunately that's behaving extremely quirky. I created a vbscript using wmi to query the asset tag of the BIOS and then I compare it to the hostname of the computer. If they don't match, I use a WMI script to rename and reboot the computer, then the script runs again on the next login.

If they do match, the script deletes the shortcut from the startup folder and then fires off a script that uses netdom to join the domain as well as populating the registry with keys to make it autologon as the domain user (this is as I mentioned classroom computers).

Unfortunately, the problem is that sometimes,oftentimes even, the file isn't deleted from startup...

And even more frustratingly, since this is inside a WIM file, it actually deletes or doesn't delete it at different times when I deploy it. It's driving me crazy that its not consistant.

I notice in the BDD that Microsoft does all kinds of black magic that works but unfortunately I haven't had time to study BDD or SMS that extensively and I'm not sure when I will have time to do so.

Share this post


Link to post
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...