Troubleshooting MDT Scripts

I have a Windows 7 Deployment Point DVD that I created using the Microsoft Deployment Toolkit 2010 for a client, and it has been a godsend during the past ten days.  Because the client wants to make copies to send to their remote locations around the country, I spent a couple of hours scripting as much as I could so that the process would be as simple as possible for the end-users, and so that the corporate computers around the country would all meet my (their) guidelines.  I tested the deployment media on physical hardware and there were absolutely no problems.  Now all that was left was for me to create a document to go with it.  To do this, I created a virtual machine within my Hyper-V laptop so that I could use TechSmith’s SnagIt tool to capture my screen shots.

…and I started getting an error telling me that ‘Windows could not parse or process unattend answer file [C:\Windows\Panther\unattend.xml] for pass [specialize]. The answer file is invalid.’

image

ARGH!

What am I to do?

Why did it work on physical hardware, and is not working in the virtual machine?

What’s different?

During my Troubleshooting LiteTouch Deployment using MDT session at TechDays Canada I remind my audience that if they get an error they shouldn’t close down the system when they get an error… there is so much to be learned from the files that might simply disappear if they are on the RAMDrive.  I pressed <Shift-F10> and looked for the guilty file, and sure enough, under the Specialize Pass section there was the error… the ComputerName field was FAR too long!

When scripting the deployment point one of the rules I included was the following lines to script the computer name to be the same as the serial number:

SkipComputerName=YES
computername=%SerialNumber%

The serial number for the Vostro laptops that the company bought is an 8 character Asset Tag.  This works perfectly because the maximum computer name can be is 15 characters.  Unfortunately the serial number of my Hyper-V virtual machine was much longer – in this case the string read:

<ComputerName>4524-0809-8640-9363-4363-6582-37</ComputerName>

Because of that the deployment was failing. 32 characters!  Of course this is not going to be limited to virtual machines.  Some vendors have longer serial numbers than others.  If you created a deployment point that works fine with your HPs that you want to use to deploy Windows 7 on a white-box PC, you may encounter the same issue.  If you have many systems that you are going to encounter the problem on then you probably will want to go back and recreate your deployment point, whether that be a USB key or (as was the case here) the ISO file.  However if you have a one-off machine that is outside the norm – say, a lab PC that you use to test applications – then for those of you who are adventurous, the following will work, and will save you doing all of that:

  1. Restart the machine as you did previously, initiating the deployment.
  2. Go through all of your screens until you get the ‘Ready to Begin’ screen, and click Begin.  The Task Sequence will start, and will go through the first few tasks pretty quickly.  When the Installing Windows… window comes up, your screen should look like the screenshot below.  At this point the Unattend.xml file that the deployment uses will have been generated and copied to the C Drive, into two distinct locations.
  3. image
  4. Press F8 to open a command prompt.
  5. Navigate to the first file location (C:\$Windows.~BT\Sources\Panther).
  6. type notepad Unattend.xml.
  7. In the Notepad window search for the string <ComputerName>.
  8. Change the string between <ComputerName> and </ComputerName> to an acceptable name (fewer than 15 characters).
  9. Save the file and exit from Notepad.
  10. Navigate to the second file location (C:\MININT)
  11. Repeat steps 6-9
  12. Type exit.

(NOTE: Typing EXIT is crucial, as the open command prompt window will prevent the Windows Installation from rebooting the system.)

Now: In the event that you get an error that the deployment is suspended, you might have to wipe the disk first… use these steps only in a clean install scenario, because it will wipe any data on the drive!

  1. Restart the virtual machine from the DVD.
  2. When Windows PE comes up, press F8.  When the command prompt (will you people finally realize this is NOT DOS!!) comes up type diskpart to start the Disk Partition tool.
  3. Within the Disk Partition tool type list disk.
  4. Make sure you pick the disk that you are installing Windows on and type Select Disk # (where # is the number of the disk).
  5. Type CLEAN

As soon as the partition is wiped you can reboot the computer and restart your deployment.

I hope this helps… now go forth and deploy, and script-sin no more!

Advertisements

One thought on “Troubleshooting MDT Scripts

  1. Wow thanks… I couldn’t figure out why my USB key kept crashing during installation! I tried this out today and it works. Thanks Mitch!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s