Jump to content

Auto Computer Naming / Ghost / sysprep.inf


Recommended Posts

This project has been in the works off and on for the last few years, and I'd like to get some input and ideas about how others might go about doing something like this, or possibly are currently making it happen.

Ideally, I'd like to be able to go to a computer, hit F12 and walk away. It would boot from the network, begin the imaging process, reboot, name itself to current conventions (rather than a random name, it would be named according to the room or user), join itself to the domain, and put itself in the appropriate OU. Once in the OU, a Group Policy Object would run, and based on the name it would load a particular set of programs onto the computer.

We have a relatively diverse set of computers, but with custom driver packs and some tweaking we've been able to create a single ghost image that works for 95% of our systems. The PXE booting aspect I took care of long, long ago, but naming is where I'm getting stuck a bit. I've written a script that can run at first boot that will rename the computer to a specified name that uses Netdom. Currently I have a simple batch file running as a GPO that executes once on all of the computers, and kicks out a text file named %macaddress%.txt that contains one line, which is the computer name. With the script that runs as admin at first login, it grabs its mac address, sets it as a variable (%mac%) then sets the contents of \\networkserver\%mac%.txt as %oldname% and uses that as its new name. Netdom will name it the old name, and join it to the domain, so all's well there.

The issue is that each summer I get about 1000 new machines to set up, so I'd like to be able to have a way to pre-specify a name for the new PCs as well. The outside of the box has the serial number as a barcode, but I don't believe it has the MAC address as a barcode. I'm thinking about going to serial numbers as the unique identifier rather than MAC address, but the issue with that is that WMI repositories are notoriously hosed, and even if you un-hose it, if a vendor or service provider replaces the motherboard on a system, they don't enter the asset tags and you end up with a bunch of machines that have no serial number, or all zeros.

Does anyone have a better idea as a usable unique identifier?

I realize this kind of skips all over the place, but hopefully someone's able to follow my ramblings and make some sense of it.

Thanks for the help!

Link to comment
Share on other sites


you know what? just try scanning every barcode on the box you can find. I have yet to see a business pc box where the MAC is not on it.

and about the stuff you can read with WMI:

I noticed the same thing. I got one brand, where they seem to have the left the product name key to the default ... which is "product name". isnt that great?

Link to comment
Share on other sites

you know what? just try scanning every barcode on the box you can find. I have yet to see a business pc box where the MAC is not on it.

and about the stuff you can read with WMI:

I noticed the same thing. I got one brand, where they seem to have the left the product name key to the default ... which is "product name". isnt that great?

If I can find the MAC addy on the box, that'd make my not-so-elegant, but freakin' awesome solution work pretty well. I'm sure I've got an old HP box sitting around somewhere, so if that's the case, I'm pretty well set there.

Yeah, WMI is an absolutely amazing tool for admins like myself who have an over-abundance of machines to take care of...but it's pretty pathetic sometimes what you find in there. We've got some tablets at work that respond "Gateway " for all of the fields. I'm sure the extra spaces are for posterity!

Link to comment
Share on other sites

BTW: not to make adverts for myself, but I'm working on a similar solution. However, I dont have a database/directory(ADS/LDAP) behind it (yet). Right now I'm trying to reproducing the way Vista setup works for XP. If you are interested, take a look at http://code.google.com/p/unixp. But mind you, it's not really the latest source there, not even well documented (working on it) and it has some minor issues I got to fix (static path names, etc).

As of now, that thing is meant to run standalone. You throw a CD/DVD into your PC, it uses diskpart to partition the harddisk with a fixed script, loads a sysprepped XP image to C:, selects a driver folder by reading the serial and manufacturer through WMI and can do HDC driver injection (per peimage.exe) and HAL-swapping (which is not supported by MS the way I did it, however, it works).

Link to comment
Share on other sites

BTW: not to make adverts for myself, but I'm working on a similar solution. However, I dont have a database/directory(ADS/LDAP) behind it (yet). Right now I'm trying to reproducing the way Vista setup works for XP. If you are interested, take a look at http://code.google.com/p/unixp. But mind you, it's not really the latest source there, not even well documented (working on it) and it has some minor issues I got to fix (static path names, etc).

As of now, that thing is meant to run standalone. You throw a CD/DVD into your PC, it uses diskpart to partition the harddisk with a fixed script, loads a sysprepped XP image to C:, selects a driver folder by reading the serial and manufacturer through WMI and can do HDC driver injection (per peimage.exe) and HAL-swapping (which is not supported by MS the way I did it, however, it works).

I believe Aaron Sorkin once said, "Good writers borrow from other writers. Great writers steal from them outright." In that vein, I'm the absolute best at writing scripts...

Thanks for the link. I'll more than likely dig through what you've got and invariably find a piece or two that applies to what I'm doing, or find something that's done more elegantly than I'm currently implementing.

I'll post some of my less-than-pretty code sometime... I'm a member of the old school, so I do everything that I can (and sometimes, things that rightfully, I can't) with batch files.

Link to comment
Share on other sites

...

I believe Aaron Sorkin once said, "Good writers borrow from other writers. Great writers steal from them outright." In that vein, I'm the absolute best at writing scripts...

Thanks for the link. I'll more than likely dig through what you've got and invariably find a piece or two that applies to what I'm doing, or find something that's done more elegantly than I'm currently implementing.

I'll post some of my less-than-pretty code sometime... I'm a member of the old school, so I do everything that I can (and sometimes, things that rightfully, I can't) with batch files.

I so doubt that there is any good piece in my code. IT WORKS (well, almost), but thats about it.

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...