Sysprep A Windows 7 Machine
Sysprep A Windows 7 Machine
com/sysprep-a-windows-7-machine-%E2%80%93-start-to-finish-v2
April 2nd: I am currently struggling with RSI injury (on my 9th month of chronic
pain) and very sorry that I haven’t been able to respond to comments. It will be a
while before I can fully use computer again, but I am determined not to give up.
Studying for CompTIA A+ cert while I rest. I actually wrote the guide below
while on oxycodone for pain, talk about determination lol. Just a little too much I
guess.
- 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.
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.
Step #3
Under the “Windows Image” header, right click and select new image.
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.
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.
1 windowsPE
2 offlineServicing
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
6 auditUser
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
SynchronousCommand[Order="2"]
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
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:
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!