Sysprep a Windows 7 Machine – Start to Finish V2

January 18th, 2010

SPREAD THE WORD, TOGETHER WE HAVE CONQUERED SYSPREP :)

Sorry for the delay, I have been struggling the past couple months with a pinched nerve in my neck. This is version 2 of a step by step guide on Sysprepping a Windows 7 machine from start to finish. I cannot take full credit on this because my first article had so many helpful comments and discussions that this is simply a combination of all the good advice written into a working guide. (I would especially like to thank George for his input on Cscript for auto activation and Nathan for input on Sysprep Audit Mode). This will guide you through the following:

- Audit Mode
- Building the unattended XML file in WSIM
- copyprofile=true command to copy the default profile (no manual copy)
- Prompt for a computer name
- Enable Administrator account
- Administrator account logs in first time automatically
- Activate windows automatically with Cscript;
- Delete sysprep XML file automatically upon completion of re-image.

Here is a list of what you will need:

- Latest version of WAIK : KB3AIK_EN.iso Version 1.0
- Windows Vista or Windows 7 Machine to build the XML file on
- ISO or DVD of Windows 7 Installation (x32 or x64)
- WinPE Boot Environment : BrianLeeJackson WinPE 3.0 BootLoader

First we are going to walk through building the XML file (answer file) and then we will walk through the actual Windows 7 imaging process.

PART 1 – XML FILE CREATION

Step #1

If you have a Windows 7 installation DVD, insert it now. Or if you have an ISO of 7, go ahead and extract it to a folder on your desktop. (I recommend 7-zip).

Step #2

Launch Windows System Image Manager. Your start menu should look like the image below:

Windows 7 WAIK Version 1

Windows 7 WAIK Version 1

Step #3

Under the “Windows Image” header, right click and select new image.

Windows System Image Manager

Windows System Image Manager

Step #4

You will now want to browse to the .CLG file in your Windows 7 installation (I am using Windows 7 Enterprise x64 in my example). It is located in the sources folder. See Image below. You can select either the .clg file or the install.wim. Both will have the same result.

Selecting CLG File - WSIM

Selecting CLG File - WSIM

Step #5

Now we need to create a new answer file. Go to the file menu and select “Create New Answer File.” Right after creating one, go ahead and simply go to file menu and select “Save Answer File.” This will give your XML file a name and save location. Now you see we have two category folders, Components and Packages. Under the Components folder you see that we have 7 options:

-1 windowsPE
-2 offlineServicing
-3 generalize
-4 specialize
-5 auditSystem
-6 auditUser
-7 oobeSystem

Step #6

These are very important as these are the steps in which the XML file is sequenced.
The next part is a little confusing. You are going to add components, from under the “Windows Image” section on the bottom left hand side to the passes on your Answer File. To add a component, you can right click on them and select “add to # pass”. There are many different options you can add, but they have to be done in a certain order and pass otherwise your sysprep might fail. I am simply going to use the one I created as the example.

Answer File - Sysprep XML

Answer File - Sysprep XML

Here is more information about adding options under the passes:

1 windowsPE

Nothing required in my example.

2 offlineServicing

Nothing required in my example.

3 generalize

amd64_Microsoft-Windows-Security-SPP_6.1.7600.16385_neutral

Set 1 for SkipRearm to allow up to 8 rearms

4 specialize

amd64_Microsoft-Windows-Deployment_6.1.7600.16385_neutral

    RunSynchronous

      RunSynchronousCommand[Order="1"]

        Order: 1
        path: net user administrator /active:yes
        WillReboot: Never

amd64_Microsoft-Windows-Security-SPP-UX_6.1.7600.16385_neutral

SkipAutoActivation: true

amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral

Computer Name: Leave blank (we will deal with this at the end)
CopyProfile: true
Registered Organization: Microsoft (you must leave this in this section)
Registered Owner: AutoBVT (you must leave this in this section)
ShowWindowsLive: false
TimeZone: Pacific Standard Time

You can delete other sub-header components if you don’t need them.

5 auditSystem

Nothing required in my example.

6 auditUser

Nothing required in my example.

7 oobeSystem

amd64_Microsoft-Windows-International-Core_6.1.7600.16385_neutral

InputLocale: en-us
SystemLocale: en-us
UILanguage: en-us
UserLocale: en-us

amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral

RegisteredOrganization: Your Company Name
RegisteredOwner: Your Name

  • AutoLogon
    1. Enabled: true
      LogonCount: 5
      Username: administrator

        Password: Administrator Password
  • FirstLogonCommands
    1. SynchronousCommand[Order="1"]

        CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
        Order 1
        RequiresUserInput: false

      SynchronousCommand[Order="2"]

        CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
        Order 2
        RequiresUserInput: false
  • OOBE
    1. HideEULAPage: true
      NetworkLocation: Home
      ProtectYourPC: 1
  • UserAccounts
    1. AdministratorPassword: Administrator Password
      LocalAccounts

        LocalAccount[Name="Administrator"]

          Action: AddListItem
          Description: Local Administrator
          DisplayName: Administrator
          Group: Administrators
          Name: Administrator

            Password: Administrator Password

    If you have questions, look at my image above to see full layout of components, it should help.

    Step #7

    K, now go ahead and save your answer file as sysprep.xml.

    Step #8

    If you want the sysprep to prompt for a computer name you need to remove a line from your XML file. Open up your XML file you saved with notepad and remove the following line:

    Sysprep XML Computer Name

    Sysprep XML Computer Name

    PART 2 – IMAGING PROCESS / RUNNING SYSPREP

    Step #9

    Install Windows 7 (Enterprise) from CD or USB flash drive, when you arrive at the welcome screen and it asks you to create a username, hit ctrl+shift+f3.
    This will reboot your machine and put your windows build in ‘audit’ mode.

    Step #10

    On reboot, you’ll automatically be logged in under the built-in Administrator account. A sysprep GUI box will appear, but you can close it and NOW begin to customize your profile.

    Step #11

    Install any software/drivers, make any profile customizations, etc.
    If you need to reboot, the computer will boot you back into the Administrator account. You will be stuck in this audit mode until you run sysprep with the /oobe parameter. After doing so, sysprep will delete/clean up the Administrator account, but if you have copyprofile=true in your unattended answer file, it will copy the customized Admin account to the default profile before deleting it.

    Step #12

    On the PC you are going to be running sysprep on, you need to create a folder called scripts in this directory: %WINDIR%\Setup\. Now you are going to create a CMD file within the %WINDIR%\Setup\Scripts directory. Right click and make a new text file called SetupComplete.txt. Remove the .txt extension and replace that with .cmd. You now have a SetupComplete.cmd file which windows will read the first time it boots up from the sysprep. We need to place a script inside the CMD file. Edit the cmd file with notepad and insert this line: del /Q /F c:\windows\system32\sysprep\sysprep.xml. This script will delete your sysprep.xml file after it has been used. If you have passwords or cd keys stored in that xml file you don’t have to worry about it being left on the computer.

    Step #13

    Once you have everything configured correctly, Copy or move your sysprep.xml file to : C:\windows\system32\sysprep. Now to run sysprep, navigate to that sysprep folder, hold SHIFT and right click and select “Open New Command Windows Here”. Next, input the following commands:

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

    Step #14

    Turn the computer back on and boot to WinPE 3.0 environment (USB stick or CD/DVD). You can use my BrianLeeJackson WinPE3.0 BootLoader to boot up from USB or CD and capture your image. Capture image and save image to network location.
    A Dell 960 or GX755 is a good standard for capturing when you want a generic image for use with multiple systems. Might require injecting additional drivers for 3rd party brands, HP, etc. Most should work though right out of the box.

    Step #15

    On reboot, Windows will run out of the box, as the /oobe is intended. As long as you put your cd key into the sysprep xml file, windows will be activated automatically in the background, you will be automatically logged into the administrator account, and the sysprep.xml file is deleted. You are now ready to use the computer or join it to the domain. Enjoy!

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    How to install Windows 7 VGA driver on Dell GX270

    December 6th, 2009

    This is a short guide on solving the problem when trying to install the VGA driver on a Dell GX270 when Windows 7 is installed.

    Step #1

    Install Windows 7 on the Dell GX270 computer. (Refer to my other articles for using ImageX and WinPE 3.0 boot environment for capturing and applying images).

    Step #2

    Once you have Windows 7 installed, at least for me, Windows Updates didn’t pick up the VGA driver automatically; leaving you with a very large resolution which is unusable.

    Step #3

    Download the Intel 82845G/GL/GE/PE/GV Graphics Controller driver (R126990.EXE). (Download Here) The drivers on Dell’s website do not work for Windows Vista or Windows 7.

    GX270 - R126990 driver

    GX270 - R126990 driver

    Step #4

    Once you have the R126990.EXE downloaded, you will need to extract the contents of the EXE to a folder. I suggest using 7-zip or Winrar. Download 7-Zip

    GX270 - Extracting the driver.

    GX270 - Extracting the driver.

    Step #5

    Now that you have the driver extracted you are going to have to install the driver manually in compatibility mode. Go into the folder you just extracted and right click on the setup.exe and go to properties and then the compatibility mode tab. You will want to enable compatibility mode for Windows Service Pack 3 and also select “Run as Administrator.”

    Run in Compatibility Mode

    Run in Compatibility Mode

    Step #6

    Click Apply, then click OK. Now run the setup.exe as you normally would and it shouldn’t complain about OS not being compatible.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Sysprep Windows 7 – Third Party Anti-Virus

    November 13th, 2009

    I have run into about 20-30 people over the last couple weeks that were having trouble sysprepping and they all narrowed it down to the same thing; their anti-virus application. It seems that the Sysprep tool is sometimes not working with a lot of the 3rd party anti-virus applications.

    Anti-Virus Applications with Known Issues

    • Norton 2009
    • McAfee
    • AVG
    • Avira
    • ESET NOD32 4.0 (User reported issues)

    Anti-Virus Applications 100% Compatible with Sysprep

    And yes, you probably noticed that both applications are made by Microsoft, go figure. If anyone notices any other anti-virus programs that are causing issues with sysprep please comment on here. Or if you have workaround for these anti-virus apps and sysprep working together please comment.

    Microsoft Security Essentials - Free Alternative

    Microsoft Security Essentials - Free Alternative

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    New WinPE 3.0 Scripts + Driver Packages Update

    November 11th, 2009

    I just updated my WinPE 3.0 boot environment scripts. They are completley free to download. You can either click on the green button on the right hand side or visit this link http://blog.brianleejackson.com/winpe-3-0-boot-environment-scripts.

    CHANGES/UPDATES AS OF NOVEMBER 12, 2009

    • Added new Windows 7 winpe.bmp wallpaper for WinPE 3.0 Boot Environment, both x32 and x64.
    • Added new drivers for WinPE 3.0 environment including some netbooks and HP eCopy machines, x32.
    • Added the newest stable version of GimageX v2.0.17, x32 and x64.
    • Removed GHOST from packages, x32 and x64.

    Also, if you have enjoyed my site or gotten useful information from it; even if I saved you an hour from compiling different information then I have accomplished my goal. However, I am now getting 10-20 emails per day asking questions about sysprepping, Windows 7 deployment, etc. It is getting hard to keep up. And with this increase in traffic comes an increase in bandwidth. If I have helped you in any way please feel free to donate any amount on the right hand side so I can keep this blog going. I have some great new tutorials planned as I jump deep into the Acresso’s AdminStudio 9.5 Repackager for Windows 7 x64.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Verizon Wireless Droid – Microsoft Outlook Sync with GMAIL

    November 8th, 2009

    The first thing I want to say is that I simply love my new Droid phone. In fact, it probably is the coolest electronic device I have ever owned. Verizon Wireless has the best service and now they have the best phone! I really think this phone is going to help boost their ratings and customers.

    This is assuming you are already using Microsoft Outlook 2007 for everything.
    The first thing I tried with the Droid was syncing my personal IMAP account with the device. Then I realized that wasn’t going to sync my contacts, calendar, etc.
    So I removed the IMAP account and then tried syncing my Microsoft Exchange account. This worked great and pulled contacts down, calendar items (buggy), and emails. But then I realized there were still nice little features missing. Because it is Google OS obviously they are wanting you to use Gmail (their product).

    So I decided to give the GOOGLE APPS a test trial run, accompanied by Google App Sync. And let me just say, it is amazing!!!!

    Functions working:

    • Microsoft Outlook 2007 is syncing flawlessly with my DROID
      (Email, Email folders, Contacts, Calendar Items)
    • Using my own business email account (brian@innovativepixels.com) for all gmail functions (requires changing MX records over to GMAIL). Not using @gmail.com for anything. This means that all masking of email is fixed.
    • A plus with using GMAIL as app on the DROID over standard email client is that I can now use an email signature from the phone, such as (Sent from my DROID).
    • The Google App Sync will export and import automatically all of your current Outlook information into your newly hosted GMAIL email account. Basically it asks you for Outlook Profile to use for your new account and then it takes a couple minutes and migrates all your data over. No manual migration necessary.
    • Another plus with using GMAIL app on DROID is that my emails are now stacked in conversations, like they are in GMAIL web client. Saves space on DROID for viewing.
    • Everything just seems to work faster and better when going through Google Apps. Also calendar is not buggy anymore.
    • Ability to see all my folders/cabinet and then be able to move emails to them when I receive them on my DROID. Your Outlook folders are converted into “LABELS” on your DROID. They still work the same as folders, but are just called something different. All changes sync to my Microsoft Outlook 2007 and to online Gmail.

    The Google APPs costs $50 per user per year but it is worth every penny for me. My entire Microsoft Outlook 2007 is now syncing flawlessly with my DROID, very fast, with all the functions and features of GMAIL but without the GMAIL branding. You definitely want to give it a try. 30 day trial is free and they don’t bill you for first 30 days.

    VERIZON WIRELESS DROID

    VERIZON WIRELESS DROID

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Zune HD 16GB 4.3 Firmware Update Trick

    November 8th, 2009

    If you are like me you probably haven’t been very happy with the Zune HD browser. The 4.3 update fixes a lot of the problems with the browser and it is a lot more responsive. After installing the update you will now have an option in settings that you can have the browser render as “mobile” or as “desktop”. (If only we could get rid of the BING search) All the firmware update changes can be found on Gizmodo. I had trouble updating my firmware, it didn’t say I needed an update, said that 4.1 was the newest version. Here is what I did to fix the problem. (I am running Windows 7, but same options apply under XP or Vista)

    Step #1

    Unplug your Zune from USB and close your Zune software.

    Step #2

    Go to your control panel.

    Zune Control Panel

    Zune Control Panel

    Step #3

    Click on Clock, Language, and Region

    Zune Region Settings

    Zune Region Settings

    Step #4

    Click on “change location”.

    Zune Change Location

    Zune Change Location

    Step #5

    Change your location to “United Kingdom”.

    Zune UK

    Zune UK

    Step #6

    Now plug your Zune back in and launch the Zune software. Go to settings at top right and then to “Player Update” on left hand side.

    Zune Player Update

    Zune Player Update

    Step #7

    It should now ask you to upgrade player to 4.3. Select “Upgrade”. This will take a minute or two.

    Step #8

    You should now see a confirmation screen saying your player is fully up to date.

    Zune Player 4.3

    Zune Player 4.3

    Step #9

    You can now go back to control panel and change your region back to US.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Windows 7 Resource Kit – My Blog in a book!

    November 4th, 2009

    I have been blogging a lot over the past year about my experiences with Windows 7, WinPE 3.0, etc. The first reason I started blogging was not only to document for myself but also because I was trying to save others some time. Well, the good news is that Microsoft finally decided to document all these topics. If you haven’t already, drop by Amazon and buy this book:
    Windows® 7 Resource Kit. It is literally my blog in a book with much more detail! Everyone that has asked me questions on this blog, 99% of the answers for them are in this book. It is 1700 pages long, and worth every page. The paperback edition includes a CD in the back with over 250 powershell scripts and an eBook of the entire book.

    Windows 7 Resource Kit

    Windows 7 Resource Kit

    Here is the layout of the book:

    Chapter 1: Overview of Windows 7 Improvements
    Chapter 2: Security in Windows 7
    Chapter 3: Deployment Platform
    Chapter 4: Planning Deployment
    Chapter 5: Testing Application Compatibility
    Chapter 6: Developing Disk Images
    Chapter 7: Migrating User State Data
    Chapter 8: Deploying Applications
    Chapter 9: Preparing Windows PE
    Chapter 10: Configuring Windows Deployment Services
    Chapter 11: Using Volume Activation
    Chapter 12: Deploying with Microsoft Deployment Toolkit
    Chapter 13: Overview of Management Tools
    Chapter 14: Managing the Desktop Environment
    Chapter 15: Managing Users and User Data
    Chapter 16: Managing Disks and File Systems
    Chapter 17: Managing Devices and Services
    Chapter 18: Managing Printing
    Chapter 19: Managing Search
    Chapter 20: Managing Windows Internet Explorer
    Chapter 21: Maintaining Desktop Health
    Chapter 22: Supporting Users with Remote Assistance
    Chapter 23: Managing Software Updates
    Chapter 24: Managing Client Protection
    Chapter 25: Configuring Windows Networking
    Chapter 26: Configuring Windows Firewall and IPsec
    Chapter 27: Connecting Remote Users and Networks
    Chapter 28: Deploying IPv6
    Chapter 29: Configuring Startup and Troubleshooting Startup Issues
    Chapter 30: Troubleshooting Hardware, Driver, and Disk Issues
    Chapter 31: Troubleshooting Network Issues
    Chapter 32: Troubleshooting Stop Messages

    In my opinion this book could be priced a lot higher for all the information it has in it. If you are nerdy enough this would make a great stocking stuffer :)

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Run only scripts that you trust. Disable Powershell Message

    October 26th, 2009

    If you are like me you have probably run into the following error when trying to run powershell scripts. This becomes very annoying and tedious if you are running different scripts on a regular basis.

    “Security Warning – Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your computer. Do you want to run –.ps1? [D] Do not run [R] Run once [S] Suspend [?] Help (default is “D”):

    Step #1

    The first thing you need to do is launch Windows Powershell.

    Step #2

    Then enter the following commands:

    get-executionpolicy

    set-executionpolicy bypass

    Powershell Trust Scripts

    Powershell Trust Scripts

    Now launch your script and enjoy not seeing that annoying message come up.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Completely removing Windows Vista/Windows 7 Printer Driver

    October 25th, 2009

    If you right click on a printer and delete it, this doesn’t remove the printer driver from the machine. Sometimes when working with print servers and testing multiple drivers there will be times when you need to completely remove a driver package from the machine so you can install a new or different one.

    Windows Vista and Windows 7 has a tool called the Microsoft Management Console (MMC) built into windows which you will use to remove the drivers.

    Step #1

    Reboot the machine and login as “Administrator”.

    Step #2

    Go to the start menu and start typing MMC, you will see the Microsoft Management Console shortcut appear in the start menu; click on it.

    MMC - Remove Print Driver

    MMC - Remove Print Driver


    MMC

    MMC

    Step #3

    Go up to the file menu and select Add/Remove Snap-in…

    MMC - Add/Remove Snap-in...

    MMC - Add/Remove Snap-in...

    Step #4

    Then scroll down in the list and select the “Print Management” snap-in and then hit “Add”.

    MMC - Print Management

    MMC - Print Management

    Step #5

    At this screen you are going to want to select “Add the Local Server”, hit Finish, and then hit ok.

    MMC - Add the Local Server

    MMC - Add the Local Server

    Step #6

    Then you can scroll down to your computer name, select the drivers tree and then right click on the driver you want to remove and select “Remove Driver Package”.

    MMC - Remove Driver Package

    MMC - Remove Driver Package

    Step #7

    Make sure you reboot your machine before trying to add new or different print drivers.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Completely removing Windows XP Printer Driver

    October 25th, 2009

    If you right click on a printer and delete it, this doesn’t remove the printer driver from the machine. Sometimes when working with print servers and testing multiple drivers there will be times when you need to completely remove a driver package from the machine so you can install a new or different one.

    Step #1

    Reboot the machine and login as “Administrator”.

    Step #2

    Go to the control panel, go up to the file menu and select “Server Properties”.

    XP Server Properties

    XP Server Properties

    Step #3

    Select the “Drivers” tab and then you will now have a list of printer drivers currently installed on the machine. You can select “Remove” to completely uninstall and delete the driver package.

    XP Delete Printer Driver

    XP Delete Printer Driver

    Step #4

    Reboot the machine and the driver is gone. You can now test new or different drivers if needed.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks