Windows 7 Automated Imaging and ZCM Registration


Building the base image

Downloads required:

Windows Driver Kit Version 7.1.0 (to get access to DPINST.exe utility)

Windows AIK for Windows 7


  • Insert the Windows Driver Kit DVD on your machine and install.

  • Browse to install folder, then down to Redist\DIFx\dpinst\MultiLin\x86 and take a copy of DPINST.exe – this will be used later.

  • Insert the Windows AIK DVD on your own machine and install Windows System Image Manager. This will be used to build the unattend.xml file for the Windows 7 image.

  • Insert the Windows 7 DVD on your own machine and take a copy of the DVD onto a folder somewhere on your machine.

  • Launch Windows System Image Manager

    • Click on File, New Answer File

  • In the bottom left window, Right click and select "Select Windows Image" and browse to either the install.wim or install_windows7.clg file (both should be in the same "sources" folder extracted from the Windows 7 Installation DVD above)

  • In the bottom left window locate the sections listed below, right click them and add to the relevant section on the popup

These are the settings for Windows 7 32-bit. For Windows 7 64-bit use the relevant sections starting with amd64_ instead of x86_

x86_Microsoft-Windows-LUA-Settings_neutral2 offline Servicing

x86_Microsoft-Windows-Security-SPP_neutral3 generalize

x86_Microsoft-Windows-Deployment_neutral4 specialize

x86_Microsoft-Windows-Security-SPP_UX_neutral4 specialize

x86_Microsoft-Windows-Shell-Setup_neutral4 specialize

x86_Microsoft-Windows-International-Core_neutral7 oobeSystem

x86_Microsoft-Windows-Shell-Setup_neutral7 oobeSystem

We now need to go through each section and change some settings.

In the Answer file Section, do the following:


Setting Name



2 offline Servicing
EnableLUAFalseDisables User Access Control

3 generalize

4 specialize
RunSynchronousAdd a new command
Order 1
Net user administrator /active:yes
Active the local administrator account

4 specialize

4 specialize
ComputerName*Generates a random Computer name. My script later on picks up BIOS name and sets computer name


ProductKeyxxxxx-xxxxx-xxxxx-xxxxx-xxxxxValid Product Key

RegisteredOrganizationLeave as Microsoft 

RegisteredOwnerLeave as AutoBVT 


TimeZoneGMT Standard TimeSet as appropriate for your region

7 oobeSystem







Set as appropriate for your region

7 oobeSystem

RegisteredOrganizationxxxxxxxxxxxxxxxxxxxxYour Company Name

RegisteredOwnerxxxxxxxxxxxxxxxxxxxxYour Company Name

TimeZoneGMT Standard TimeSet as appropriate for your region

Subsection AutoLogonEnabledTrue 

LogonCount3Do 3 auto logons before leaving user at login screen (to cater for automated scripts and reboots)


PasswordPa55wordSet as appropriate - make sure it matches up with other sections in this guide

Subsection FirstLogonCommandsCommandLine

Order 1

RequiresUserInput false
cscript //b C:\windows\system32\slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx 


Order 2

RequiresUserInput false
v1.0\powershell.exe -Command "&{set-executionpolicy RemoteSigned -Force}"
Enables Powershell Scripts


Order 3

RequiresUserInput false
v1.0\powershell.exe "c:\setup\Win7Image-Script1.ps1"

Subsection OOBEHideEULAPageTrue 



Subsection UserAccountsAdministratorPasswordPa55word 

Add record for user administrator
Description: administrator

DisplayName: administrator

Group: administrators

Name: administrator

Password Pa55word

Save the unattend.xml answer file

  • On Target Windows 7 machine

  • Install Windows 7 from DVD, making sure that you zap any and all partitions on the disk at the start

  • Once initial install is complete, and you're prompted to create a username on the welcome screen, press CTRL-SHIFT-F3 to reboot machine into admin audit mode.

    AT THIS POINT, take an image as a "pre-sysprep" image if needed

  • On reboot, you'll be automatically logged in under the built-in administrator account. A SYSPREP GUI box will appear – close this for now. You are now ready to carry out any customizations.

  • Due to issues with a strange access rights issue on Windows 7 64-bit (that worked fine in Windows 7 32-bit), create a folder called C:\SETUP and make sure administrators group has full control

  • Place the unattend.xml file created above into the folder C:\WINDOWS\SYSTEM32\SYSPREP

  • Bring up a command prompt and browse to C:\WINDOWS\SYSTEM32\SYSPREP

  • Run the following command

    • SYSPREP /generalize /oobe /shutdown /unattend:unattend.xml

  • Wait for the machine to shutdown

  • You are now ready to take an image of the Windows 7 SYSPREP'd machine.

Additional addon-images were created following instructions located here as follows:

Win7-Addon-Drivers.zmgContains the driver files for any unknown devices – creates a folder on C: called C:\SETUP\DRIVERS

Contains 32 and 64 bit drivers

Win7-Addon-Scripts.zmgContains the relevant Powershell Scripts and any utilities that are required as part of the imaging process. Files are stored under C:\SETUP

Current Files are:

BiosConfigUtility.exe - HP Utility to read BIOS settings - use to rename computer




dpinst.exe, dpinst64.exe, dpinst.xml - used to do a hardware scan for any unknown devices

Win7-32-Addon-ZCMAgent.zmg (or Win7-64-Addon-ZCMAgent.zmg)Latest ZCM agent copied to C:\SETUP.

The Scripts above call this to register the machine in ZCM. Since agent name is always the same, this can be replaced with the latest agent whenever required.

The important thing to make sure when creating these is to make sure that the partition number on the image matches the partition number inside the Windows 7 ZMG file for the boot disk – as a default this is partition 2 as partition 1 is the 100MB hidden area for Windows 7.

The imaging bundle applies the relevant base image (32 or 64 bit), followed by these addon images.

i.e. ZCM Windows Bundle has the following 4 images listed as part of the image






Win7Image-Script3.ps1 - needs updating for your specific domain information re name of domain, relevant user account, and password to join computer to domain

One final step to take is to delete the C:\SETUP folder to remove any files that may contain passwords etc.


Editor's Note: When it comes to Windows 7 Migration projects, ZENworks can be your new best friend. Check it out.


How To-Best Practice
Comment List
Parents Comment Children
Related Discussions