Reaper's Edge‎ > ‎

Dear Sysprep from Windows 7... I hate you.

posted Sep 26, 2010, 9:26 AM by Michael Wilson   [ updated Sep 26, 2010, 9:29 AM ]
If you're reading this blog and are even moderately interested then I think it's safe to assume you've messed with Sysprep for Windows XP. It was a great product with a simple setup. I miss it dearly. For Windows 7 Microsoft decided to change Sysprep and make it more 'featureful'. What they really did was turn it into a complicated mess while stripping out some of the mission critical pieces. Fail.

I discovered all of this while banging my head against the wall trying to get the new Sysprep to do what I need it to do. I never did. 

First you need to understand a little bit about my environment. Nothing real special, just an Active Directory domain with roughly 1000 PCs. Under XP we used an imaging setup where when the PC booted from being imaged it would run mini-setup. Again, nothing shocking there. During mini-setup it would prompt one of my techs to input a computer name and from there it would join the domain automatically. See, I'm a fat image kind of guy and I customized our images to eliminate every single click and keystroke that I could spare to reduce the time it would take to do a build, and to reduce the number of places a mistake could be made. Naturally, I wanted to do the same thing with Windows 7... that's where my life became miserable.

Windows 7 doesn't have mini-setup. Okay, no big deal. I'm sure they left us with something. I mean, look at Windows System Image Manager and all the settings I can put in my unattend.xml file. Alas, there was a bug.

Windows 7 handles the setup following Sysprep in a number of Passes. Each pass has certain options you can set, and they can only be set in particular passes. As you may have guessed, these passes are sequential. That said, lets set this up for you.

During one of the passes you have the option of assigning a computer name. Okay, unfortunately you can only either hard code the name in the Unattend.XML (giving every PC imaged the same name) or let it randomly generate a name for you. You can't have it prompt you to input a name. That said, you can have it ask you for a name much later, during the OOBE setup. OOBE stands for Out Of Box Experience and is what you normally see when you pick a PC from Bestbuy and turn it on for the first time. 

Here's the problem, auto-joining the domain happens before OOBE. That means that when it joins the domain it does so with either a hard coded name or a randomly generated one. Then, when you name the PC during OOBE, it breaks the trust relationship with the domain and you have to essentially start over.

I poked at this for days before finally giving up and going third-party. Meet my new best friend, MySysprep2.

It lets you do something very special, take all of the work you've already done setting up Sysprep and your unattend.xml file, and add a prompt for computer name before it joins the domain.

Coming up in a later post I'll talk more about the unattend.xml file and show you a copy of the one I'm using.