Link to home
Start Free TrialLog in
Avatar of Casey Weaver
Casey WeaverFlag for United States of America

asked on

Sysprep script for renaming hostname/joining domain

I'm trying to come up with a script that can do this and I'm completely lost, and frankly I'm not even sure it's possible.

We have lost of machines, all of which  need a hostname of host****, being the numbers. So an example would be host0001, or host1274. All machines are identical so they can easily be sysprepped, it's just getting this hostname thing down.

I want the hostname automated. This would be fairly simple if it wasn't for the fact that this sysprep is also used on repaired/replacement computers. Which means the script needs to see that for ex:

host0383 is damaged, removed from the room, new system brought in its place, and set in. The script needs to see that 1-382 is taken, but 383 is not longer alive (like no ping) and therefore it takes 383 and assignes it that host number. So far I have two ideas, but no idea behind the coding of either.

First idea, can the script ping each number, running ping host0001 ect, each time skipping the number because the system replied back, until it hits one that doesn't reply back.

Second idea, run a database of some sort that simply has the host names with an Active and Non-Active designation. A webGUI could be used to mark a system number as non-active when it's going to be repaired/replaced. The script could then maybe take the next non-active number *and* mark that number in the database as active.

Any ideas folks? The hosts should be Windows 7 Enterprise being joined to a Windows Server 2008 R2 server.
ASKER CERTIFIED SOLUTION
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Casey Weaver

ASKER

I ended up with WDS, and used MDT to make the images. I'm still working with setting up MDT to use a SQL database stored on the server using SQL 2008 Express, and if it works I'll leave a comment here. But for now I'll close the question this way. Because it points me in the direction, I will say the WDS answer is good because I never thought of that before the suggestion.

Here's a link to what I'm following:
http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part15.html