Computer Tips and Tricks
Get the latest posts via rss

Monday 23 November 2009

Windows 7 Sysprep and WDS

I decided to try the Sysprep process for windows 7 in advance of our roll-out early next year, to get a feel for the process.
UPDATE: I have added a new Blog Creating a Windows 7 Sysprep unattended XML with a breakdown of the unattended XML creation and configuration.
For the test base image, I want to create an "admin" image with administrative tools, AD, Exchange 2007 and SQL 2005 on 64 BIT Windows, to be used by the sys admins for further testing.

Upon searching, the majority of posts are Vista related, but this step by step guide was found to be very useful, particularly in creating the answer file using the WAIK (Windows Automated Installation Kit), and I would like to take this opportunity to thank Brian Lee jackson.

The first attempt was possibly a bit too much too soon, as i built an image with all software installed that i required. This failed the sysprep, and according to the logs looked to be a hardware driver issue. Not to worry, i have fortunately copied the disk before hand, so it was just a case of imaging back, finding and fixing the error. Not so....

So, we started again (note this is now we and not me) from scratch, and have decided to test as we go.

We have started as follows:
  • Installed Windows 7 64 BIT
  • Joined Domain and added to an existing OU for testing
  • Disabled Windows Media Player Network Sharing Service
  • Disabled Windows Search Service
  • Set a password for the local Administrators account
  • activated the administrators account
  • Logged out and back on with local administrator
  • copied the pre prepared answer file to c:\windows\system32\sysprep
At this point we decided to clone the disk before attempting the first sysprep.

After cloning the disk i logged in as the local administrator and and opened up and Administrative command prompt from c:\windows\system32\sysprep and ran the following command

sysprep /generalize /oobe /shutdown /unattend:win7sysprep.xml

where win7sysprep.xml is the name of our answer file located in the same directory. You are presented with the following

After a few minutes of processing, this failed with a "Fatal Error".

Upon inspection of the setuperr.log, this can be found in "C:\Windows\System32\sysprep\Panther", this looks to be pointing to a hardware issue, or that's all we have been able to find referring to "returned error code 31".

Full output of log was as follows:
2009-11-23 15:37:22, Error [0x0f0039] SYSPRP spopk.dll::Sysprep_Generalize_Opk:Could not register SetupCl; status = 0xC0000061
2009-11-23 15:37:22, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'C:\Windows\System32\spopk.dll,Sysprep_Generalize_Opk', returned error code 31
2009-11-23 15:37:22, Error [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 31
2009-11-23 15:37:22, Error [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep generalize internal providers; hr = 0x8007001f


A point of interest here, the sysprep process had got far enough to strip out all accounts from the machine, apart from the originally created account on first boot after build. The local Administrator account was disabled and the machine had been removed from the domain. This left no account with administrative rights to log back in after a reboot, and therefore the machine was rendered useless (thankfully we took that disk image)

After some thought, we tried logged in with a domain account with admin rights to remove from the domain. This prevented the above errors and the sysprep completed.

We have now uploaded the image to our WDS server and a new issue has arisen. When running WDS the image was not shown in the list of available images. Firstly we had to create a new 64 BIT boot image (helps to start with 64 BIT PE), but the following command is also required to be run on the WDS server to enable 64BIT images;

wdsutil /set-server /architecturediscovery:yes

After these changes we imaged a client with the test base image successfully. The client logged onto the domain successfully (machine account created) and all looks OK.

Only small issue was when we tried with unattended setup from wds. The first answer file that we pointed it too it did not like, so back to the start with creating one with WAIK.

After a number of trials with various settings in the imageunattend.xml we now have a fully working image installing from WDS. Only annoyance is that there looks to be no way of prompting for a machine name during the image process. You have to log onto the newly imaged machine and rename it. A shame really as time zone, default language, domain and OU etc. can all be configured in the imageunattend.xml.

So we have finally got to the point of creating the following image,

  • Windows 7 64 BIT
  • Office 2007
  • Exchange 2007 admin tools
  • AD admin tools
  • SQL 2005 Admin tools
  • Symantec end point protection
  • flash, shockwave, quicktime and java
  • Vsphere Client
  • All updates applied to date
this has been sysprepped successfully, and the WIM uploaded to our WDS server, and successfully tested on a number of clients, including VMWARE virtual machines.

All in all, once you get used to WAIK for creating the answer files, Windows 7 SYSPREP is a relatively painless process.

3 comments:

Emalf said...

We got there in the end.

Anonymous said...

If you ever get locked out of your computer again, the old Offline NT Password & Registry editor disk will allow you to reset it, and it still works on Windows 7. Open source, free!

http://pogostick.net/~pnh/ntpasswd/

Anonymous said...

We are using MS Deployment server to deploy Win7 images without issue. That is, until we added Adobe Acrobat X Pro. Once we added to this to our image, the administrator account is disabled by default when imaging a machine. Has anyone else seen this? Note: When using Adobe Acrobat 9 pro...this did not happen...

Post a Comment