Preparing a Hardware Independent Windows 7 Image

by natrinicle in Circuits > Microsoft

177497 Views, 32 Favorites, 0 Comments

Preparing a Hardware Independent Windows 7 Image

Fullscreen capture 9162010 122800 PM.bmp
The purpose of this Instructable is to allow system administrators of multiple computers to create a single system image that can then be pushed onto multiple machines easily.  This saves time as an image can be pushed in just a few hours versus having to manually install everything on each machine.  Expect creating the image to take up to several weeks depending on how many applications are required.

Materials Required:
  • A spare computer or a virtual machine
  • Another computer that can be used to assist with the imaging process
    (It will be helpful to have Windows 7 installed on it as well)
  • A copy of Windows 7 Enterprise
    (We are using a KMS Licensing Server on campus instead of product keys, however each setup may be different)
  • Any additional software that may be required in the image
  • A copy of an imaging software
    (I personally use FSArchiver, however Norton Ghost or Acronis are also good choices)
  • Internet access
  • A blank DVD and a DVD burner

NOTE:

If using a spare computer make sure that the processor is an AMD or that Intel machines are the only computers that will be restored to in the future.  For some reason Intel's processor driver is incompatible with AMD machines but not vice versa.  Also, if using a virtual machine, make sure to run it on a computer that's powerful enough to run both the original operating system as well as the virtual machine.

Install Windows

Fullscreen capture 9162010 115809 AM.bmp
Fullscreen capture 9162010 115828 AM.bmp
Fullscreen capture 9222010 32338 PM.bmp
Fullscreen capture 9222010 32343 PM.bmp
Fullscreen capture 9222010 32350 PM.bmp
Fullscreen capture 9222010 32405 PM.bmp
Fullscreen capture 9222010 32718 PM.bmp
Fullscreen capture 9222010 32723 PM.bmp
To install Windows 7, insert the windows disc into the computer or mount the virtual disc image if using a virtual machine.  Then, press any key to start up off of the Windows disc when prompted.  After that, follow the image notes for a more detailed description of each of the settings.  Once you get to the username dialog box, after the reboot, press ctrl-shift-f3 to enter audit mode.

Install the Windows Automated Installation Kit (WAIK)

Fullscreen capture 1042010 115932 AM.bmp.jpg
AutoPlay 1052010 122358 PM.bmp
Fullscreen capture 1052010 122444 PM.bmp
While Windows is installing, it is time to install the Windows Automated Installation Kit (WAIK) in order to prepare the sysprep settings file.  Do this on a computer other than the one the image is being created on.  The sysprep file is basically just a set of commands and settings that the computer will apply after the image is pushed onto a new computer.  The sysprep file will be created in the next step with the WAIK.
  1. Download the KB3AIK_EN.iso file from this link.
  2. Double click the ISO file to open the Windows Disc Image Burner
  3. Select the drive to burn to
  4. Choose whether or not to verify the disc
  5. Choose burn to start the burn process
  6. Re-insert the disc after it is done burning
  7. Click Run StartCD.exe from the AutoPlay options
  8. Click Windows AIK Setup from the setup splash screen
  9. Follow the installer through by clicking next until the end and then click finish

Prepare the Sysprep Settings File

Fullscreen capture 1062010 64341 AM.bmp.jpg
Fullscreen capture 1062010 65108 AM.bmp.jpg
Fullscreen capture 1062010 121212 PM.bmp.jpg
Once WAIK is installed it is time to create the Sysprep settings file, unattend.xml.  Follow the steps below while customizing fields as necessary.  Also attached is a sample unattend.xml which can be loaded instead of creating a new XML file if desired.
  1. Copy the install_Windows 7 ENTERPRISE.clg file from the Sources folder on the Windows 7 installation disc to somewhere that it can be found easily.
  2. Open the Windows System Image Manager from the Microsoft Windows AIK start menu folder that was created when WAIK was installed.
  3. Click the new answer file icon at the top of the System Image Manager.
  4. Click yes to when it asks to open a windows image.
  5. Drag the items below from the Windows image components section on the lower left of the Windows System Image Manager onto the corresponding steps in the center top answer file section.
  6. Set the correct information for each component's sub settings in the component properties section referring to the sample unattend.xml below.  For the synchronous commands in steps 3 and 7 simply right click on the section that it goes in and click Insert New SynchronousCommand.
  7. Click file, save answer file as, and choose a place to save the file as unattend.xml.
  8. Open the unattend.xml file in Notepad and make sure the ComputerName opening and closing tags line is removed in order to have setup prompt for a computer name after imaging.

Sample unattend.xml settings:

3 Generalize

+x86_Microsoft-Windows-Security-SPP_neutral

SkipRearm=1

4 Specialize

+x86_Microsoft-Windows-Deployment_neutral

+RunSynchronous

+RunSynchronousCommand[order="1"]

Order=1
Path=net user administrator /active:yes
WillReboot="Never"

+RunSynchronousCommand[order="2"]

Order=2
Path=net accounts /maxpwage:unlimited
WillReboot=Never

+x86_Microsoft-Windows-Security-SPP-UX_neutral

SkipAutoActivation=true

7 oobeSystem

+x86_Microsoft-Windows-International-Core_neutral

InputLocale=en-us
SystemLocale=en-us
UILanguage=en-us
UserLocale=en-us

+x86_Microsoft-Windows-Shell-Setup_neutral

DoNotCleanTaskbar=true
RegisteredOrganization=(Organization)
RegisteredOwner=(Owner)

+Autologin

Enabled=true
LogonCount=1
Username=Administrator

+Password

Value=(AdminPassword)

+FirstLogonCommands

+SynchronousCommand[Order="1"]

Action=AddListItem
CommandLine=(Anything needing to be run after setup is done.  We run a hardware inventory application called OCS Inventory)
Description=(User friendly name of the application)
Order=1
RequiresUserInput=(True if application needs user input)

+OEMInformation

HelpCustomized=true
(Fill in the other fields with organization's information)

+OOBE

HideEulaPage=true
NetworkLocation=Work
ProtectYourPC=true

+UserAccounts

+AdministratorPassword

Value=(AdminPassword)

Downloads

Install Programs & Customize Settings

Fullscreen capture 1062010 62835 PM.bmp.jpg
Fullscreen capture 1042010 60504 PM.bmp
Each time the image is booted it will display a Sysprep dialog box; press cancel every time it appears.  Now, install any programs and customize any settings needed for the image.  A few of the most common programs and settings are listed below.  Some needs and requirements may differ depending on why the image is being created.

Programs
Microsoft Office
CCleaner
Google Chrome
Mozilla Firefox

Settings
Screensaver
Wallpaper
Windows Update
GPEdit.msc

Sysprep the Machine

Fullscreen capture 1062010 25913 PM.bmp.jpg
Make sure Windows and all applications have been fully installed and configured before starting this step.
  1. Copy the unattend.xml file that was created in step 3 into the %WinDir%\system32\sysprep folder.
  2. Open a command prompt as the administrator.  Do this by opening the start menu, clicking all programs, clicking the accessories folder, right clicking on the command prompt, and clicking run as administrator.
  3. Run the command "C:\Windows\System32\Sysprep\Sysprep.exe /generalize /oobe /shutdown /unattend:unattend.xml" in the command prompt.


NOTE:

An image should only be sysprepped once.  Be sure to take a virtual machine snapshot or image the computer before sysprepping if later changes are necessary.

Pull the Image

Ghost32 11.5.1 1062010 65926 PM.bmp
Now, transfer the image from the hard drive to a file with an imaging software.  This is called: "pulling the image."  There is a wide variety of software that this can be done with, and each has it's own way of accomplishing the process.  Read the documentation for the specific imaging software being used, and pull the image from the hard drive to a file.

Push the Image

Ghost32 11.5.1 1062010 70302 PM.bmp
Now that the image has been pulled from the hard drive, it can be "pushed," or in other words restored, onto additional hard drives provided that there are enough Windows 7 licenses.  Also, be sure to check the imaging software's licensing requirements as some require additional licenses for each machine that the image is pushed onto.  Please read the imaging software's documentation for help if additional support is required with this process.

Conclusion

DSCN0453.JPG
DSCN0454.JPG
If this process is followed through, it can save untold amounts of time usually spent setting up computers.  This also ensures that all computers maintain the same settings and applications throughout the organization.