With Windows System Preparation Tool (Sysprep) tool, you can create customized Windows 10 or 11 reference images. You can install apps, drivers, and slipstream updates to a Windows installation image. After that, you can deploy Windows image to users’ computers within your company.
In this article, we’ll show how to use Sysprep to create the reference image of Windows 10 21H1 (19043.1320) and Windows 11 21H2 (22000.258) builds. Use this guide to create a Windows image that is ready and you can deploy it on a physical or virtual machine (VDI solutions).
What is SysPrep?
Before deploying a Windows image on users’ computers, you need to configure a reference image. Install the necessary drivers, applications, and configure other Windows settings. The resulting image must be generalized by deleting computer-specific information (SID, GUID, etc.). You can generalize the Windows image with the Sysprep utility.
Sysprep allows you to delete all the information related to a specific operating system instance. This includes unique identifiers (SID, GUID, etc.), the Windows activation reset, and installing apps and drivers in the Audit mode.
All the configuration of the operating system before you run Sysprep remains untouched. This includes the installed software, personalization and network settings, installed and pinned Metro apps on the start screen, File Explorer, and other parameters.
In Windows 10/11 and Windows Server 2019/2022, the Sysprep.exe utility is located in folder C:\Windows\System32\sysprep.
After you installed a prepared reference Windows 10 image and configured in the correct way (with certain installed software, with the operating system settings, with the specified permissions and restrictions), you can deploy it to all computers of the company using MDT, WDS, SCCM or manually (take a look at Deploying Windows 10 with MDT and WDS).
Benefits and Disadvantages of Using Sysprep
Syprep’s benefits:
- The customized reference Windows 10/11 image allows you to quickly deploy a ready-to-work environment on a user’s computer. You do not need to install drivers, programs, security updates. Also no need to configure custom Windows Settings on each computer;
- You can deploy the Windows image using the answer (unattended) file. After the installation, you do not need to select the various options on the initial Windows 10 setup screen;
- At any time, you can extract the image, make changes to it, and update it with the deployment tool.
Disadvantages of Sysprep:
- The size of the Windows reference image can be significantly larger than the clean Windows 10 or 11 installation ISO image;
- Periodically you have to update the versions of programs and drivers injected into the reference image, and install the latest security updates;
- You cannot use the Sysprep tool on domain-joined computers. Sysprep will remove the computer from the AD domain;
- You can run Sysprep up to 1001 times on a single Windows image. After reaching this limit, you should recreate your Windows image.
How to Create a Windows 10 or 11 Reference Image?
You can create your reference WIM image of Windows 11 or 10 through the following steps:
- Perform clean Windows 10/11 install from the ISO image, then enter the Audit Mode;
- Install apps, drivers, and configure the system settings;
- Prepare the operating system environment using the Sysprep utility;
- Boot into Windows PE and capture an image using the DISM tool.
Then, the resulting image WIM can be added to the installation disk or deployed using different tools such as MDT, WDS, DISM, or ImageX.
Customizing Windows 11 and 10 in Audit Mode with Sysprep
You need to customize your reference Windows Image in the Audit Mode. On the installed Windows 10/11 OS, you can boot Windows to Audit Mode or OOBE by pressing Shift + Ctrl + F3 on the OOBE (out-of-box experience user experience), or the Windows Welcome screen. You can also enter Audit Mode using Sysprep. To do this, open the Sysprep folder with File Explorer, hold down Shift, right-click on an empty space and select the Open PowerShell windows here or Open in Windows Terminal option.
Then run the command:
C:\windows\system32\sysprep\sysprep.exe
In the System Preparation Tool window, select the options:
- System Cleanup Action: Enter System Audit mode;
- Shutdown Options: Reboot;
- Press the OK button.
In our case, Sysprep is returning the following error:
System Preparation Tool 3.14
Sysprep was not able to validate your Windows installation. Review the log file at %WINDIR%\System32\Sysprep\Panther\setupact.log for details. After resolving the issue, use Sysprep to validate your installation again.
To find out the reason why Sysprep cannot start on your computer, press Win + R and run the command:
%WINDIR%\System32\Sysprep\Panther\setupact.log
Look for the Error lines in the setupact.log file. In our case, the error looks like this:
2021-11-19 06:12:56, Error SYSPRP Sysprep_Clean_Validate_Opk: Audit mode cannot be turned on if reserved storage is in use. An update or servicing operation may be using reserved storage.; hr = 0x800F0975
2021-11-19 06:12:56, Error SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing ‘Sysprep_Clean_Validate_Opk’ from C:\Windows\System32\spopk.dll; dwRet = 0x975
2021-11-19 06:12:56, Error SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Cleanup.xml; dwRet = 0x975
2021-11-19 06:12:56, Error SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; dwRet = 0x975
2021-11-19 06:12:56, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x975
2021-11-19 06:12:56, Error [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep cleanup internal providers; hr = 0x80070975
In our case, the reason for the Sysprep error is specified here: “An update or servicing operation may be using reserved storage”. This means you cannot use Sysprep at this time, because your Windows image is locked by some changes. This can be installed updates, installation of Windows features, system programs, antiviruses, etc.
Go to Settings > Windows Updates. As you can see, there are several Pending Updates. Finish installing security updates, restart your computer, and run Sysprep again.
Tip. Another error “Sysprep was not able to validate your Windows installation” was covered in this guide.
The computer will automatically restart and boot to the Audit Mode. Windows automatically boots and logs in with the built-in administrator account when in the Audit Mode. Further, this account will be disabled.
Windows 11/10 will boot in this mode no matter how many times you reboot your computer until the Sysprep is running.
There is only one visible sign to understand that you’ve entered the Windows Audit Mode desktop — the Sysprep dialog in the middle of the display. Do not close the Sysprep utility window — you will need it at the end of the configuration step. Minimize it.
In Audit Mode, you can configure your Windows reference image. We will take a look at several popular steps that sysops configure most often in their reference image.
Step 1: Install OEM Information and Logo
You can set your company branded info in the computer properties windows. In this example, we will configure OEMLogo, Company name, tech support website, and working hours. The easiest way to configure these settings is through the registry. Create a text file oem.reg, and copy the following code into it:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation]
“Logo”=”C:\\WINDOWS\\oem\\OEMlogo.bmp”
“Manufacturer”=”TheITBros, LLC”
“Model”=”Windows 10 Pro 21H1”
“SupportHours”=”9am to 5pm ET M-F”
“SupportURL”=”https://theitbros.com”
Note. First, create the graphic file C:\WINDOWS\oem\OEMlogo.bmp with your company logo.
To apply the reg file, double-click on it, and accept registry changes. As a result, these settings will be imported into the registry.
After rebooting in the System Properties, you can see the following branded info:
Step 2: Install the Drivers and Apps
You can install drivers and third-party programs you would like to see in your Windows 10/11 image.
You can install programs manually, or using the Windows 10 package manager — Chocolatey.
Now install the Chocolatey. To do this, run the PowerShell console with administrator privileges. Enter the following commands:
Set-ExecutionPolicy Bypass -Scope Process -Force; `
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Restart the PowerShell console. Now you can install more programs with a single command.
Let’s say, we want to install Opera, Google Chrome, VLC media player, Adobe Acrobat Reader DC, 7Zip, K-Lite Codec Pack Full, and Zoomit using choco. Run the command:
choco install 7zip, Opera, googlechrome, vlc, adobereader, k-litecodecpackfull,zoom
Tip. You can find packages by their names with the command choco search opera.
On Windows 11, you can use the new built-in WinGet Package Manager to install the required software (about 3000 programs available in WinGet repo). To install the same set of programs, run the command:
winget install --id=7zip.7zip -e && winget install --id=Opera.Opera -e && winget install --id=Google.Chrome -e && winget install --id=VideoLAN.VLC -e && winget install --id=Adobe.Acrobat.Reader.32-bit -e && winget install --id=CodecGuide.K-LiteCodecPack.Full -e && winget install --id=Zoom.Zoom –e
Tip. You can use the WinGet online repository browser (https://winstall.app/) to select the programs you want to install and generate the WinGet installation script.
You can also install drivers for all computers and laptops models on which you want to deploy this reference Windows 10/11 image. Download and extract the driver packages to a specific directory. Then search for all *.inf files, and inject all the drivers described there to the Windows image with the command:
for /f %i in ('dir /b /s *.inf') do pnputil.exe -i -a %i
If you need to reboot Windows to install the application or update, you can do it. After reboot, the system will return to audit mode.
Note. You can clean up your driver repository from driver duplicates using our script.
Step 3: Disable Telemetry and Data Collection in Windows 10/11
Windows 10 and 11 collect information about the operation of users on the computer. Examples of handwriting and voice samples, location information, error reports, calendar contents — all of these can be sent to Microsoft servers.
If you do not want the OS sending data to Microsoft’s telemetry servers, you can disable the Telemetry and Data Collection services. Run the elevated Command prompt, and execute the following commands:
sc delete DiagTrack sc delete dmwappushservice echo ““ > C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-DiagTrack-Listener.etl REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
Also, you can disable tracking in Windows 10 and 11 using the DisableWinTracking tool from GitHub.
Step 4: Install Windows Security Update in Audit Mode
Starting with Windows 8.1, you cannot install updates using the Windows Update Center in the Settings panel in the auditing mode. The Windows Update Center checks if the system has completed the OOBE stage. If not, the update won’t be performed.
To update the system from the console, you can take the PSWindowsUpdate Module from TechNet Gallery.
Save the PSWindowsUpdate.zip archive to a USB drive, and (this is important!) right-click on it > Properties > Unblock.
Extract the PSWindowsUpdate.zip to both folders:
- %USERPROFILE%\Documents\Windows\PowerShell\Modules;
- %WINDIR%\System32\Windows\PowerShell\v1.0\Modules.
To download and install all available Windows updates, run the commands:
PowerShell -ExecutionPolicy RemoteSigned -Command Import-Module PSWindowsUpdate; Get-WUInstall -AcceptAll -IgnoreReboot
That’s all! Available updates will be downloaded from the Windows Update servers and installed automatically.
Step 5: Uninstall Built-in Microsoft Store Apps
Also, you can uninstall built-in UWM apps, but it’s really up to you. So, if you don’t want to uninstall built-in apps, just skip this step.
Here is a list of the pre-installed Microsoft apps in Windows 10 21H1.
Get-AppxPackage *3dbuilder* | Remove-AppxPackage Get-AppxPackage *windowsalarms* | Remove-AppxPackage Get-AppxPackage *windowscalculator* | Remove-AppxPackage Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage Get-AppxPackage *windowscamera* | Remove-AppxPackage Get-AppxPackage *officehub* | Remove-AppxPackage Get-AppxPackage *skypeapp* | Remove-AppxPackage Get-AppxPackage *getstarted* | Remove-AppxPackage Get-AppxPackage *zunemusic* | Remove-AppxPackage Get-AppxPackage *windowsmaps* | Remove-AppxPackage Get-AppxPackage *solitairecollection* | Remove-AppxPackage Get-AppxPackage *bingfinance* | Remove-AppxPackage Get-AppxPackage *zunevideo* | Remove-AppxPackage Get-AppxPackage *bingnews* | Remove-AppxPackage Get-AppxPackage *onenote* | Remove-AppxPackage Get-AppxPackage *people* | Remove-AppxPackage Get-AppxPackage *windowsphone* | Remove-AppxPackage Get-AppxPackage *photos* | Remove-AppxPackage Get-AppxPackage *bingsports* | Remove-AppxPackage Get-AppxPackage *soundrecorder* | Remove-AppxPackage Get-AppxPackage *bingweather* | Remove-AppxPackage Get-AppxPackage *xboxapp* | Remove-AppxPackage
The list of built-in MS Store Apps on Windows 11 21H2 has changed. Use the following PowerShell script to remove the preinstalled Windows 11 apps:
Remove built-in MS Store Apps on Windows 11 21H2:
#AV1 Codec Get-AppxPackage *AV1VideoExtension* | Remove-AppxPackage #News app Get-AppxPackage *BingNews* | Remove-AppxPackage #Weather Get-AppxPackage *BingWeather* | Remove-AppxPackage #PowerShell Get-AppxPackage *PowerShell* | Remove-AppxPackage #WebP image support Get-AppxPackage *WebpImageExtension* | Remove-AppxPackage #HEIF image support Get-AppxPackage *HEIFImageExtension* | Remove-AppxPackage #Windows Terminal Get-AppxPackage *WindowsTerminal* | Remove-AppxPackage #Music app Get-AppxPackage *ZuneMusic* | Remove-AppxPackage #Movies and TV Get-AppxPackage *ZuneVideo* | Remove-AppxPackage #MS Office Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage #People app Get-AppxPackage *People* | Remove-AppxPackage #Maps Get-AppxPackage *WindowsMaps* | Remove-AppxPackage #Help and tips Get-AppxPackage *GetHelp* | Remove-AppxPackage #Voice Recorder Get-AppxPackage *WindowsSoundRecorder* | Remove-AppxPackage #Notepad Get-AppxPackage *WindowsNotepad* | Remove-AppxPackage #MS Paint Get-AppxPackage *Paint* | Remove-AppxPackage #Sticky Notes Get-AppxPackage *MicrosoftStickyNotes* | Remove-AppxPackage #PowerAutomate Get-AppxPackage *PowerAutomateDesktop* | Remove-AppxPackage #Xbox and related apps Get-AppxPackage *Xbox* | Remove-AppxPackage #Feedback Hub Get-AppxPackage *WindowsFeedbackHub* | Remove-AppxPackage #Microsoft To-Do Get-AppxPackage *Todos* | Remove-AppxPackage #Calculator Get-AppxPackage *WindowsCalculator* | Remove-AppxPackage #Alarms and Clocks Get-AppxPackage *WindowsAlarms* | Remove-AppxPackage #Teams/Chat Get-AppxPackage *Teams* | Remove-AppxPackage #Microsoft Edge Get-AppxPackage *MicrosoftEdge* | Remove-AppxPackage #Your Phone Get-AppxPackage *YourPhone* | Remove-AppxPackage #Spotify Get-AppxPackage *SpotifyAB.SpotifyMusic* | Remove-AppxPackage #Screen & Sketch/Snipping tool Get-AppxPackage *ScreenSketch* | Remove-AppxPackage #Solitaire Collection Get-AppxPackage *MicrosoftSolitaireCollection* | Remove-AppxPackage #Photos Get-AppxPackage *Windows.Photos* | Remove-AppxPackage #OneDrive Get-AppxPackage *OneDriveSync* | Remove-AppxPackage #Skype Get-AppxPackage *SkypeApp* | Remove-AppxPackage #Xbox Console Companion Get-AppxPackage *GamingApp* | Remove-AppxPackage
Copy the list of commands for your Windows build, paste them into the PowerShell console, and press Enter:
Generalizing Windows 10/11 Image Using Sysprep
If your computer has a static IP address configured, specify that the address should be obtained automatically (from a DHCP server). You can do that in the network adapter settings.
Or, you can use the following PowerShell script to automatically get an IP address from a DHCP server:
$IPType = "IPv4"
$adapter = Get-NetAdapter | ? {$_.Status -eq "up"}
$interface = $adapter | Get-NetIPInterface -AddressFamily $IPType
If ($interface.Dhcp -eq "Disabled") {
If (($interface | Get-NetIPConfiguration).Ipv4DefaultGateway) {
$interface | Remove-NetRoute -Confirm:$false
}
$interface | Set-NetIPInterface -DHCP Enabled
$interface | Set-DnsClientServerAddress -ResetServerAddresses
}
After everything is configured, you can run the Sysprep and select the options:
- System Cleanup Action: Enter System Out-of-Box Experience (OOBE);
- Shutdown Options: Shutdown;
- Check the Generalize option.
After generalizing the Windows image, it will start from Out-of-Box Experience (OOBE) mode and reassign unique SIDs during the first boot.
Using Answer Files with Sysprep for Unattended Windows 10/11 Installation
You can use an answer file together with the System Preparation (Sysprep) tool. It allows configuring unattended Windows Setup settings. This step is optional (used to automatically specify various parameters that must be configured when the image is at first run). You can skip this step, and go straight to the step of capturing a Windows image.
The answer file may contain the answer to each question. This must be selected when installing Windows and choosing the initial settings (region, language, product key, keyboard, account, and privacy setting, etc.). Follow the steps during the out-of-box experience (OOBE).
Due to the answer file, the number of installer screens is significantly reduced.
How to Create Windows 10 Answer File Using Windows System Image Manager?
You can create an answer file manually (this is simple XML). But it’s more convenient to generate the correct answer file using the Windows System Image Manager (SIM) tool. You can do it from the Windows Assessment and Deployment Kit (ADK).
Download the Windows Assessment and Deployment Kit (ADK) for Windows 10 or ADK for Windows 11. Use the ADK version for the Windows version you want to deploy.
Run the adksetup.exe file with administrator privileges. Then select Deployment Tools to install (it includes the latest version of DISM and Windows System Image Manager).
You will need install.wim file with the Windows 10 or image you want to deploy. You can copy the install.wim file from the sources directory on the installation Windows 10 ISO image. If only the install.esd file is available in the sources directory, you can convert it to the install.wim.
Let’s create an answer unattended file for Windows 10 21H1.
Run the Windows System Image Manager with administrator privileges (C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\WSIM\imgmgr.exe). Select File > New Answer File.
SIM will prompt you to specify a Windows image file for which you want to create an answer file. Specify the path to the before installed install.wim file.
Wait for the SIM to mount the Windows installation image and create the catalog file (.clg). This will take some time, after which the install_Windows 10 Pro.clg file will appear in the directory with the install.wim file.
Note. If you try to open the install.wim file of your Windows 10 build using WSIM from an older version of the ADK, you may receive an error message:
Windows SIM was unable to generate a catalog
In order to fix this error, you need to install the latest ADK and WSIM available for your Windows build.
Select your Windows 10 edition. If there is only one edition of Windows in your install.wim file, it will be selected automatically.
Using WSIM, you can configure various parameters for the answer file. For example, you can configure the Windows product key (if you are using KMS or MAK keys), time zone, organization and owner info, default language and region settings, input locales, etc.
First of all, we need to do the most important thing: to tell Sysprep to copy all our customizations to the default user profile.
To do this, in the Windows Image section, find the amd64_Microsoft-Windows-Shell-Setup__neutral section. Right-click on it and select Add Setting to Pass 4 specialize.
Then, in the Answer File panel, expand section 4 Specialize > amd64_Microsoft-Windows-Shell-Setup__neutral. Set the CopyProfile value to TRUE.
Additionally, you can configure the following options in the Answer file.
Pass 1 Windows PE
Choosing an installation language in WinPE:
Microsoft-Windows-International-Core-WinPE InputLocale: en-US; SystemLocale: en-US UILanguage: en-US UserLocale: en-US
The Windows 10 Product key:
Microsoft-Windows-Setup -> UserData -> ProductKey -> Key = {specify your MAK or GVLK key}
To automatically accept user agreement:
Microsoft-Windows-Setup -> UserData -> AccepptEula = True
Pass 7 oobeSystem
Skip Microsoft account creation screen (MSA):
Microsoft-Windows-Shell-Setup –> OOBE -> HideOnlineAccountScreens = True
Do not ask 3 security questions for your local account:
Microsoft-Windows-Shell-Setup –> OOBE -> ProtectYourPC= 3
Create a local administrator account and set a password for it:
Microsoft-Windows-Shell-Setup –> UserAccounts –> LocalAccounts -> Insert New Local Account Name: admin Group: Administrators
All empty (blank) answer file parameters must be removed.
To check the settings in answer files, select in Tools > Validate Answer File option. If you configured everything correctly, a message should appear in the Messages console: No warning or errors.
Save the answer file by choosing File > Save Answer File As > autounattend.xml.
Now you can close WSIM.
Generalize Windows Image Using Answer File
Now you can use your autounattend file to Sysprep your Windows 10 image. Run the elevated command prompt, and execute the following command (replace the path to autounattend.xml with yours):
c:\windows\System32\Sysprep\sysprep.exe /generalize /oobe /generalize /shutdown /unattend:C:\ps\autounattend.xml
With the /generalize option the Sysprep will remove unique computer data. This allows you to safely deploy this reference Windows 10 image on another workstation or laptop. After executing the command, the computer will shut down.
Capture Reference Windows 10/11 Using DISM after Generalize
After shutting down your computer, you can capture a customized Windows 10 image using MDT. You can also use other special tools for capturing a Windows image or using DISM. Below we will consider the DISM option.
Note. In previous versions of Windows, the ImageX tool could be used to capture and deploy an image. In the latest Windows 10 and 11 builds, you can do all this with DISM.
Boot the computer with the Windows reference image into Windows PE. You can do this by booting the computer from the Windows 10/11 installation disc, or recovery disc.
On the language selection screen, press Shift + F10.
In the command window that opens, type Diskpart command. Use the list vol command to identify the drive letters. In our example, the installed Windows image is located on drive D.
To capture the image, run the command:
dism /capture-image /imagefile:D:\win10referenceimg.wim /capturedir:d:\ /name:"Win10 Pro reference image"
/imagefile — the wim image file that we need to create;
/Capturedir — the reference Windows install folder.
Copy the wim Image file from a local disk. Import it into your deployment software (MDT, SCCM), or put it on the installation drive (rename the file to install.wim).
Running Sysprep on Windows 10 is a process that prepares an operating system for disk cloning and restoration. It’s primarily used to deploy the same OS installation on multiple computers. You’ll need to access the Sysprep tool, configure the settings, and run the tool. The following steps will guide you through this process.
In this section, we will walk through the steps you need to take to run Sysprep on a Windows 10 machine. By the end, you will have a Windows 10 installation that is ready to be cloned and deployed to other computers.
Step 1: Open the Sysprep Tool
Open File Explorer and navigate to C:WindowsSystem32Sysprep.
Here you’ll find the Sysprep executable. This is the tool required to prepare your Windows installation for cloning. Make sure you’re logged in with administrative privileges, or you won’t be able to run the tool.
Step 2: Run the Sysprep Executable
Double-click sysprep.exe to launch the Sysprep tool.
Once the tool opens, you’ll see a dialog box with options for what actions to perform. This is where we’ll configure the settings for our preparation process.
Step 3: Choose the Generalize Option
In the Sysprep dialog box, check the Generalize checkbox.
This option removes all system-specific data, which is crucial for deploying the image to multiple machines. Without this, each cloned copy will retain the unique system data from the original machine, leading to potential conflicts.
Step 4: Select the Shutdown Option
Under Shutdown Options, select Shutdown from the dropdown menu.
This will shut down your computer once the Sysprep process is complete. It ensures that your machine is properly prepared and not running when you move on to creating a disk image.
Step 5: Start the Sysprep Process
Click the OK button to start the Sysprep process.
The process can take several minutes to complete. During this time, the tool will remove all unique system information and generalize the installation. Once finished, your computer will shut down.
After running Sysprep, your Windows 10 installation will be generalized and ready for cloning. The machine will shut down automatically, signaling that the process is complete and it is safe to create a disk image for deployment.
Tips for Running Sysprep on Windows 10
- Back up important data: Before running Sysprep, make sure to back up any important data. The process will remove system-specific configurations.
- Close all applications: Ensure that all applications are closed before running Sysprep to avoid any unexpected errors.
- Check for updates: Make sure Windows is fully updated before running Sysprep. Any pending updates can cause issues.
- Run as administrator: Always run Sysprep with administrative privileges.
- Test deployment: After creating your image, test it on a single machine to ensure everything works as expected before deploying it to multiple systems.
Frequently Asked Questions about Running Sysprep on Windows 10
What does Sysprep do?
Sysprep removes system-specific data to prepare a Windows installation for cloning and deployment to multiple computers.
Can I run Sysprep multiple times on the same computer?
Yes, but there are limits. Microsoft recommends not exceeding more than three Sysprep runs on the same image.
Will Sysprep delete my personal files?
No, Sysprep doesn’t delete personal files but removes system-specific data and configurations.
Is it necessary to use Sysprep before cloning a Windows installation?
Yes, using Sysprep ensures that the cloned system will not have conflicts due to unique system information from the original machine.
Can I undo the Sysprep process?
No, once Sysprep is run and the machine is generalized, the process cannot be undone.
Summary
- Open File Explorer to
C:WindowsSystem32Sysprep. - Run
sysprep.exe. - Select the
Generalizeoption. - Choose
Shutdownunder Shutdown Options. - Click
OKto start the process.
Conclusion
Running Sysprep on Windows 10 is a crucial step when preparing an operating system for deployment across multiple machines. This process removes all unique system data, ensuring that cloned installations don’t conflict with each other—a bit like setting the stage before opening night. Following the steps outlined above will make the process smooth and efficient.
Remember, always back up your data and close all applications before starting. After running Sysprep, your computer will be ready for imaging and deployment. For further reading, consider looking into more advanced deployment strategies or Microsoft’s documentation on Sysprep.
Feel ready to generalize and deploy your Windows 10 installation? Give it a go, and enjoy the streamlined efficiency that comes with a well-prepped system!
Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.
Друзья, привет. В этой статье поговорим о штатной утилите Windows Sysprep. Её работа до сих пор на страницах сайта рассматривалась только в контексте использования инструмента, участвующего в процессе создания своих дистрибутивов операционной системы. Но эту утилиту можно использовать и в других целях. Что это за цели, и как в процессе их достижения применять Sysprep?
Sysprep – утилита, присутствующая на борту Windows 7-10 – является средством отвязки операционной системы от драйверов комплектующих конкретного компьютера и отдельных профильных данных.
Такая отвязка предусматривается преимущественно для подготовки эталонного образа Windows – состояния системы с внесёнными настройками и установленным софтом – к дальнейшему развёртыванию на множестве компьютерных устройств. Что всерьёз облегчает работу системщиков OEM-производителей и корпораций. Все те фирменные ноутбуки с предустановленными в среду Windows брендовыми надстройками и программным обеспечением, от которых попробуй ещё избавиться – это результат развёртывания на них операционной системы, эталонный образ которой создавался на базе чистого её дистрибутива и потом дорабатывался в режиме аудита. И в этом процессе на одном из этапов участвовала утилита Sysprep.
Sysprep производит удаление из Windows драйверов комплектующих компьютера, и при следующем запуске система автоматически устанавливает новые драйверы для, соответственно, новой конфигурации оборудования. Утилита также обнуляет SID, проводит очистку системного журнала событий, удаляет содержимое системной папки «Temp», удаляет точки отката – в общем, зачищает следы своей работы на текущем устройстве, чтобы с новым запуском Windows начать работу по-новому. Как если бы операционная система была только что установлена. При необходимости Sysprep может до трёх раз сбросить активацию системы.
Чтобы запустить утилиту, жмём Win+R, вписываем «Sysprep» и в открывшейся системной папке двойным кликом открываем EXE-шник.
Для каких целей можно использовать эту утилиту?
Если вы, друзья, хотите создать свою сборку Windows – со своими предустановленными программами, внедрёнными обновлениями, выполненной активацией, изменёнными настройками и т.п., вы будете использовать Sysprep перед захватом настроенного образа системы. А как создаются свои сборки Windows, этому у нас на сайте посвящён целый раздел статей.
Замена важных компьютерных комплектующих типа материнской платы или процессора в системах Windows 8.1 или 10 обычно не влечёт за собой синий экран смерти. В большей степени этому подвержена Windows 7. Но акцент на слове «обычно», ситуации могут быть разные. Лучше всё же в любой версии системы перед заменой материнки или процессора выключить Windows с предварительным запуском Sysprep. Её запуск отвяжет систему от текущих драйверов устройств (т.е. попросту удалит их). И при следующем запуске компьютера драйверы установятся по-новому. Этот способ поможет не только избежать возможного появления синего экрана смерти, но и предотвратит ещё одну проблему, которая может проявится не сразу, а через какое-то время работы компьютера в новой конфигурации – конфликт старого и нового драйвера заменённого устройства.
Запускаем Sysprep перед непосредственным выключением компьютера для замены в нём материнской платы или процессора. В окне утилиты выставляем действие «Переход в окно приветствия OOBE». В параметрах выключения выбираем «Завершение работы».
Если в процессе замены материнской платы или процессора Sysprep не использовалась, не беда, утилиту можно запустить в любой момент позднее. Если, конечно же, в этом есть необходимость — в работе Windows наблюдаются проблемы из-за того, что драйвер старого устройства конфликтует с драйвером нового. Запускаем Sysprep. В её окне выбираем переход в окно OOBE, а в параметрах завершения – перезагрузку.
Sysprep удалит драйвер старой материнки и процессора вместе с прочими драйверами. И, как и в предыдущем случае, при следующем запуске Windows они установятся по-новому. Это, кстати, универсальный способ решения проблем с драйверами. Его можно использовать и в других ситуациях – например, когда при сбое работы Windows или её некорректном обновлении до новой версии слетают драйверы устройств и потом не хотят устанавливаться. Sysprep может даже помочь в переустановке драйверов режима работы жёсткого диска IDE, AHCI, RAID, NVMe. Не уверен, что всегда, но в части случаев точно. Но вы можете попробовать: перед тем, как менять в BIOS режим работы жёсткого диска, сделайте сброс драйверов с помощью Sysprep.
Чтобы можно было перенести свою наработанную Windows на другой компьютер, создатели ПО для резервного копирования в своих продуктах реализуют специальные технологии по отвязке драйверов комплектующих при восстановлении из бэкапа. Такие технологии есть, например, у бэкаперов Acronis и AOMEI – соответственно, Acronis Universal Restore и AOMEI Universal Restore. Есть такая технология также у EaseUS Todo Backup. Эти технологии, по сути, делают то же, что и Sysprep, только не перед захватом образа, а на этапе развёртывания Windows, т.е. восстановления её из бэкапа. Но тогда как Sysprep можно пользоваться совершенно бесплатно, она является частью Windows, технологии типа Universal Restore обычно поставляются в платных редакциях программ для резервного копирования. И если, к примеру, Acronis весь платный, то с помощью средств резервного копирования AOMEI или EaseUS и участия утилиты Sysprep совершенно бесплатно можем перенести свою рабочую Windows на другой компьютер. Ведь у программ AOMEI Backupper и EaseUS Todo Backup базовый функционал, куда входит обычное резервное копирование и восстановление Windows, бесплатный.
Чтобы перенести наработанную Windows на другую конфигурацию железа, подготавливаем загрузочный носитель с программой для резервного копирования. Если вам, друзья, нравится программа EaseUS Todo Backup, вот статья, как создать загрузочную флешку и работать с неё, создавая системные бэкапы и восстанавливая их. А если вам нравится программа AOMEI Backupper, можете скачать готовый ISO-образ с ней для записи на флешку или оптический диск.
Загрузочный носитель с бэкапером подготовили, теперь запускаем Sysprep. В её окне выбираем переход в окно OOBE, а в параметрах выключения – завершение работы.
Запускаем компьютер с загрузочного носителя с бэкапером. Создаём резервную копию уже отвязанной от драйверов Windows.
При создании указываем местом хранения резервной копии либо вместительную флешку, либо USB-HDD, либо внутренний жёсткий диск, который потом можно будет временно подключить к новому компьютеру. Далее подсоединяем флешку или жёсткий диск с резервной копией к другому компьютеру, загружаемся с загрузочного носителя с бэкапером и восстанавливаем Windows.
При восстановлении Windows её драйверы будут установлены по-новому.
Примечание: друзья, по теме переноса Windows на другой компьютер с отличным железом смотрите также детальный мануал с использованием разных инструментов в статье сайта «Как перенести Windows 10 на другой компьютер» (применимо также к Windows 7 и 8.1).
Ещё одна функция Sysprep – возможность сброса активации. В идеале эта функция предназначается, опять же, для отвязки эталонного образа Windows от активации и поставки модифицированного дистрибутива системы без вшитого ключа продукта. Но поскольку нигде не написано и мокрой печаткой не закреплено, что эту функцию можно использовать в других целях, сброс активации с помощью Sysprep знающие люди используют для продления 30-дневного триал-срока Windows 7. Активацию системы можно сбросить трижды, следовательно, в целом триал-срок работы с «Семёркой» может составить 120 дней.
Как сбросить активацию Windows 7? Запускаем Sysprep. В её окне выбираем переход в окно OOBE, ниже ставим галочку «Подготовка к использованию», в параметрах завершения указываем перезагрузку.
Примечание: Сбросить активацию системы можно и другим способом — с помощью командной строки. Этот способ мы рассматривали в статье о Windows Embedded 7.
Сброс активации с помощью Sysprep также можно использовать для продления срока бесплатных пробных лицензий Evalution ознакомительных Windows. Такие предлагаются IT-специалистам компаний в рамках проекта TechNet Evaluation Center компании Microsoft. В число таких ознакомительных систем входит Windows 10 Корпоративная и LTSB. Их официально можно бесплатно использовать 90 дней, а потом нужно либо покупать ключ продукта, либо переустанавливать систему, чтобы заново начался отсчёт дней Evalution-лицензии. Но если под конец 90-дневного срока сбросить активацию Evalution с помощью Sysprep, Windows не нужно будет переустанавливать ещё 90 дней, а потом ещё таких же 90 дней. В итоге получим 360 дней бесплатного использования.
После использования Sysprep с указанным действием «Переход в окно приветствия OOBE» Windows запустится на этапе задания региональных и профильных параметров. Этот этап мы всегда проходим при установке системы. Здесь нужно указать страну, раскладку клавиатуры и создать новую локальную учётную запись.
В эту новую учётную запись можно даже не входить, если она сама автоматом не запустится. Если запустится, выходим на экран блокировки, заходим в свою старую учётную запись.
И потом из своей учётки можем удалить новую учётку.
- В процессе использования утилиты sysprep у вас могут выходить различные ошибки, читайте о них в отдельной статье
-
О том, как использовать Sysprep при переносе Windows написано здесь.
Last updated on June 1, 2021
Businesses need to replicate similar configurations of the Windows OS for hundreds and even thousands of employees. This can be done by creating a Windows image of a customized installation and deploying it across multiple PCs. But before cloning a Windows installation, any unique identifiers, such as the system ID (SID), must be removed. This is done through the Windows System Preparation Tool, or Sysprep.
Learn how to use Sysprep to deploy multiple Windows 10 desktops and virtual machines the smart way.
What Is Sysprep in Windows 10 Used for?
For each Windows installation, the OS assigns a unique system or security identifier (SID) to the particular computer. To clone the same Windows OS on multiple computers within your organization, you can create a disk image of the original installation and deploy it to other PCs. But when you create a disk image, identifiers that are unique to each installation, such as the SID and Internet Protocol (IP) address, are replicated as well. This disk image cannot be deployed across other computers operating in your organization’s internal network without causing problems. For example, Windows Server Update Services (WSUS) uses the SID to identify each computer and cannot recognize multiple computers sharing a SID, making it hard for administrators to manage updates and hotfixes.
Therefore, before deploying a Windows image on another computer, it must undergo a process called generalization. Generalization means removing any computer-specific information from the image before deploying it to other computers. And that is exactly what you use Sysprep in Windows 10 for. Sysprep is Microsoft’s utility for generalizing a Windows image so that it can be used by multiple PCs simultaneously. It removes SIDs and other PC-specific information and driver cache to create a generic Windows OS image that can be deployed across thousands of PCs. It also enables generating new SIDs and other characteristics so that the Windows image can function on other PCs.
By deploying a single generic image, administrators can save time and conveniently set up and maintain thousands of PCs with similar configurations, business-specific applications and necessary drivers. They can also test the configurations for all employees whenever changes are made through a privileged audit mode. All in all, it can reduce the cost of providing technical support significantly and simplify ongoing maintenance for the IT department.
What Are the Limitations of Windows 10 Sysprep?
Before running Sysprep for Windows 10 installation, you must consider certain limitations. For instance, you can use only the version of Sysprep that comes with the Windows version that needs to be cloned for generalization. And if you upgraded your Windows OS to a newer version, you won’t be able to use Sysprep. Here are some other limitations that the administrators must be aware of:
- If your PC is running multiple OSes, Sysprep must be run separately for each captured image.
- For customized applications to function properly after the capture and deploy process, drive letters must be consistent between the reference PC and the destination PC.
- Running Sysprep may not replicate the server role configurations in the Windows image.
- If you run Sysprep on a New Technology File System (NTFS) partition, you will not be able to read or recover the stored encrypted files.
- Before capturing an image, the Windows installation must have the drivers for plug and play devices such as sound and video cards.
- You can use the Microsoft-Windows-Deployment/Generalize command to prepare a PC for capturing the Windows image, but the RunSynchronous command cannot be used for automating Sysprep.
- If you are on a domain, Sysprep cannot be used. However, it can be used for PCs from a workgroup. Running Sysprep will automatically remove the PC from that domain. But if the domain has a strong password policy, Sysprep keeps that.
- If running Sysprep generates an error, you will have to recapture the image before running Sysprep again.
Finally, administrators must ensure strong passwords for all user accounts. Running Sysprep on a PC with a weak password may disable the user from logging in again.
How Do You Use Sysprep to Create Generic Windows Images?
You can create a generic Windows image through audit mode or through unattend files. You can configure Windows to boot to audit mode instead of the default Out-of-Box-Experience (OOBE). Audit mode enables you to customize the Windows configurations as per the company’s requirements and capture an image to deploy across other computers in the company.
Here’s a step-by-step guide on how to create a generic Windows image using the Sysprep tool:
- Boot your Windows in audit mode. You can either close the System Preparation Tool window that appears or let it be.
- Customize the installation by changing configurations, adding drivers and programs. Just avoid installing applications from the Microsoft store to avoid issues with drive letter inconsistencies between the reference and destination PC.
- Run the Sysprep tool by clicking Generalize, Shutdown and OK in the System Preparation Tool window that appeared right after booting in audit mode. This step will generalize the installation, and the system will shut down.
However, if you had closed the System Preparation Tool window, you can reopen it through the command prompt by typing
%WINDIR%\system32\sysprep\sysprep.exe
Alternatively, you can run:
%WINDIR%\system32\sysprep\sysprep.exe /generalize /shutdown /oobe command
This will generalize and shut down without having to open the window. You can use the /mode:vm option for generalizing a Virtual Hard Drive (VHD) to be deployed on the same Virtual Machine (VM) or hypervisor.
You can now capture your image with DISM. Test the image extensively before deploying it to reference computers.
You can also generalize the image using attend files by adding a few settings:
- You can use the Microsoft-Windows-Deployment/Generalize setting. Then set the mode to OOBE or Audit mode, and set ForceShutdownNow to true to generalize the image automatically.
or
- You can generalize the system and boot it in Audit mode by using the Microsoft-Windows-Deployment/Reseal setting to the oobeSystem configuration pass and then set the mode to Audit.
When your Windows Setup processes the unattend file, it will generalize the installation.
After deploying the generic image to a destination computer, the SID and other erased identifiers must be provided for the OS to function. You can use an answer file to configure unattended Windows Setup settings automatically. An answer file is a list of components and settings that the computer applies to the system when configuration passes run. By using an answer file with the Sysprep command, the computer will automatically enter the computer name, SID, IP address and other necessary parameters specified in the answer file when the Windows image runs for the very first time. You can use the Sysprep/unattend: <file_name> command for specifying a different answer file.
What Are the Advantages and Disadvantages of Using Sysprep?
Using Sysprep to create generic Windows 10 images has its own benefits and disadvantages. Capturing a customized Windows 10 image and deploying it across all devices in an organization can reduce the workload on the IT department considerably. You do not have to configure Windows settings and install security updates separately for each device.
Using answer files with Sysprep can make re-entering the generalized information much faster and easier. Once the Windows image is deployed and boots for the first time, the computer will read and enter the specified information automatically. You can also update the Windows image as needed by changing the configurations and using the deployment tool.
Apart from the limitations discussed earlier, using Sysprep has some other disadvantages as well. For instance, the size of the Windows image is considerably larger than the original Windows 10 installation. You will also have to update the drivers and other programs on the Windows image as newer versions come out.
Simplifying Deployment of Guest Virtual Machines Through Parallels RAS Templates
Parallels® Remote Application Server (RAS) makes it extremely convenient to create Remote Application Server templates to deploy across a large number of virtual machines. Using Parallels RAS templates for Virtual Desktop Infrastructure (VDIs) or Remote Desktop Session Hosts (RDSH), administrators can set up as many guest virtual machines as they need—easily and on the go. All you have to do is prepare the virtual machine by installing Parallels RAS Guest Agent and perform the following steps:
- From the Parallels RAS Console, navigate to Farm> VDI Hosts> RAS Templates, and hit the + button.
- Enter the properties in the Parallels RAS Template Wizard, choose a clone method, and hit Next.
- You can either create the template by using Microsoft Sysprep, or choose RASprep, which is a lighter version of Sysprep. Also, specify other details for guest preparation, and hit Next.
- Choose the license key management type, and hit Next.
You now have a template. You can also choose to test the newly created template through automated VM testing and VM deployment.
Experience how fast and simple it is to deploy similar setups on-demand, multiple times by downloading a 30-day trial of Parallels RAS.
References
Wikipedia
Altaro
upenn.edu
Redmondmag.com
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I’ve put together a simple help guide to get you through this process. The aim is to achieve that first deployment image quickly and easily.
This article builds on my previous two sysprep articles:
- Windows 8/8.1
- Windows 7
Files you will need…
— Windows Assessment and Deployment Kit (Windows ADK) for Windows 10
From the kit you need to install the Deployment Tools which contains Windows System Image Manager (SIM) used for creating unattend .xml files. This should be install on a computer not being used for imaging.
- Home Page
- Direct Link
— Windows 10 image.wim
To create an unattend.xml file to be used for sysprep, you will also need the image.wim file located on the Windows 10 installation disk you used to Install Windows on your image computer (located in the Sources folder).
Let’s get started…
Install Windows 10 on your image computer. Here are initial settings I use.
Initial OS Load
During Install (leave defaults unless stated
- Choose the Custom (advanced) option: Setup partition/s as needed. Format your partition/s.
- Let’s get connected: Skip and click Next
- Get going fast: Customize settings
Customize Settings
- Personalization: All off
- Location: All off
- Browser and protection: All off
- Connectivity and error reporting: All off
- Choose how you’ll connect: Join a domain
- Who is going to use this PC?: Operator (no password)
Immediately After Install
- Logon using the Operator account you created above.
- Activate Windows then disconnect the computer from the Internet.
This will ensure that the built-in apps do not update otherwise your sysprep will fail. - Uninstall built-in apps using PowerShell. Run PowerShell as Administrator. Paste the following commands onto the PowerShell command line and hit Enter.
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *Appconnector* | Remove-AppxPackage
Get-AppxPackage *windowscalculator* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *CandyCrushSaga* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *Messaging* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *ConnectivityStore* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *CommsPhone* | Remove-AppxPackage
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *WindowsScan* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage *Office.Sway* | Remove-AppxPackage
Get-AppxPackage *Twitter* | Remove-AppxPackage
Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Get-AppxPackage *XboxOneSmartGlass* | Remove-AppxPackage
Open in new window
- Confirm that all the apps have been uninstalled. The shortcuts should no longer appear on the All Apps start menu.
- The following four apps should still be present as they cannot be removed.
- Cortana
- Contact Support
- Microsoft Edge
- Windows Feedback
- NOTE: In Windows 8.1 the Store app could not be uninstalled. This has changed in Windows 10. if you would like to make this available to all users then you should not permanently uninstall preinstalled apps. Useful apps that you may want users to have access to are: Store, Calculator and Voice Recorder
- Following the uninstall instructions above will allow the apps to be reinstalled on first log on for all new users. To remove certain apps you will need to script this at logon or just after the user logs in.
- Enable the local Administrator account. Set a password for the account. Password never expires (optional).
- Update the local Operator account. Set a password for the account. Password never expires (optional).
Now, install all necessary programs, run windows updates, configure the start screen, create local user accounts and configure the profile and OS the way you would like it to be. Find below some tips and tricks to add to your image. When completed, the computer should almost be ready to be sysprepped.
Additions – Image Tips and Tricks
Create SetupComplete.cmd File
On your image computer browse to the C:\Windows\setup directory. Within the Setup folder create a new folder named Scripts. Within the Scripts folder create a file named SetupComplete.cmd. Commands placed in this file will run just before you are presented with the Windows logon screen. We’ll add some commands to this file shortly.
Run First Log On Commands
You can do this a few ways, including through your unattend.xml file. I choose to create a script and call it when users log in for the very first time. Launch.exe will call Cleanup.exe, which contains the commands to run.
Here is the code for the Launch.vbs script:
Set WshShell = WScript.CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strAppData = WshShell.ExpandEnvironmentStrings("%APPDATA%")
'-----------------------------------------------------------------------
' Run computer cleanup script
Set objShell = CreateObject("WScript.Shell")
strCleanup = strAppData & "\Scripts\Cleanup.exe"
objShell.run "cmd /c " & strCleanup,0,False
'-----------------------------------------------------------------------
WScript.Quit
Open in new window
Convert Launch.vbs to an executable (Launch.exe) and place it in Operator’s Startup folder. This file will get deleted on completion of Cleanup.exe. You should add this file just before you’re ready to run sysprep as you may need to reboot your computer at different stages.
Note: To create and compile my scripts I use VbsEdit. It’s costs $59 but you can install it on multiple machines and it comes with a lifetime license.
Now let’s create the Cleanup.exe script. Here is the code for the Cleanup.vbs:
Set WshShell = WScript.CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
strAppData = WshShell.ExpandEnvironmentStrings("%APPDATA%")
strLocalAppData = WshShell.ExpandEnvironmentStrings("%LOCALAPPDATA%")
strUserProfile = WshShell.ExpandEnvironmentStrings("%USERPROFILE%")
strAllUsers = WshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
'-----------------------------------------------------------------------
' ADD COMMANDS HERE
'-----------------------------------------------------------------------
' Delete Launch.exe
strAppData = WshShell.ExpandEnvironmentStrings("%APPDATA%")
strLaunch = strAppData & "\Microsoft\Windows\Start Menu\Programs\Startup\Launch.exe"
If objFSO.FileExists(strLaunch) Then
objFSO.DeleteFile strLaunch, True
End If
'-----------------------------------------------------------------------
WScript.Quit
Open in new window
You can add any commands you like in this script. Here you can re-install OneDrive, which we will go over later in the guide. At the end of the script Launch.exe will get deleted so that it does not run again for the currently logged in user. Copy Cleanup.exe to %AppData%\Scripts. You will need to create the Scripts folder as it does not exist.
Cleanup.exe and Launch.exe will become part of the Default profile. It will only run when a new user logs in for the very first time.
Adjust Display Settings
You may notice that some programs when opened do not display as sharp as others. In my case, as an example, Adobe Acrobat. The program seems fuzzy or blurry when opened. If this is the case for you then check the following setting:
- All Apps — Settings — Display
- Change the size of text, apps and other items: Set the slider to 100%. I find in some cases the default is 125%.
Boot To Desktop
Boot right to the desktop. Navigate to: All Apps – Settings – System – Tablet Mode
When I sign in: Go to the desktop
Here you’re also able to set how your device handles switching from desktop to tablet mode.
WinSAT prepop (Windows System Assessment Tests Scores)
You may lose the aero theme after sysprep. Run the following command at an elevated command prompt:
WinSAT prepop
Open in new window
This will generate the WinSAT prepop .xml results files to the Datastore directory, located at:
%WINDIR%\performance\winsa
This enables you to keep the configured aero theme after running sysprep (otherwise it will be reset back to basic). Additional informa
Restart the computer then log back in as Operator. Make sure the theme is still set to your default theme. If needed, set it back to your default theme.
PowerCFG Command (GUID for Default power plan)
Specify the default power plan in your unattend.xml file. Run the following at an elevated command prompt:
Powercfg –list
Open in new window
Look for your default power plan. Write down the guid for the plan. We will add this to your unattend.xml file later.
Slipstream Drivers
To slipstream drivers into your Windows image you can use the command line utility “pnputil.exe”.
If you need a certain driver installed in the image, like an adapter, scanner or printer driver, and do not want your users to be prompted for the driver, then add it to the DriverStore in your Windows image. The command to add a driver using this utility is (HP001.inf is an example driver):
pnputil.exe -a HP0001.inf
Open in new window
The command needs to be run at an elevated command prompt. More information about this command can be found here.
Disable Windows Features or Noticifactions
Using notepad, create the following registry files to disable features or notifications. Copy and paste the following code then save the file with a .reg extension. For example DisableBackupMonitoring.re
Disable Backup Monitoring:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsBackup]
"DisableMonitoring"=dword:00000001
Open in new window
Disable Password Reveal:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main]
"DisablePasswordReveal"=dword:00000001
Open in new window
Disable IE Suggested Sites:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Suggested Sites]
"Enabled"=dword:00000000
Open in new window
Note: You can also apply the registry files via group policy.
OneDrive Setup
When you use the CopyProfile switch in your unattend file, the OneDrive shortcut in the All Apps menu continues to point to the Operator account instead of the currently logged in user. To resolve this issue OneDrive needs to be re-installed on first log on for each user. Do the following when logged in as Operator:
Manually copy the OneDrive Update folder from within the Operator profile to the ProgramData folder:
%LOCALAPPDATA%\Microsoft\ OneDrive\Update to %PROGRAMDATA%\Microsoft\On
Run the following commands at an elevated command prompt to clean up the old OneDrive folders:
move "%LOCALAPPDATA%\Microsoft\OneDrive" "%LOCALAPPDATA%\Microsoft\OneDrive.old"
del "%APPDATA%\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" /q/s
rd "%LOCALAPPDATA%\Microsoft\OneDrive.old" /q/s
rd "%USERPROFILE%\OneDrive" /q/s
Open in new window
To clean up the old OneDrive registry entries, create a registry file named OneDriveCleanup.reg using notepad and paste the following code. Run the registry file.
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\OneDrive]
Open in new window
Now you can add the following code to the Cleanup.exe file you created above to re-install OneDrive when the user logs in for the very first time.
' Run OneDrive Setup
strOneDrive = strAllUsers & "\Microsoft\OneDrive\Update\OneDriveSetup.exe /silent"
objShell.run "cmd /c " & strOneDrive,0,True
Open in new window
All folders will be recreated, including the All Apps shortcut.
Create Unattend.xml File
When the computer is ready you’ll need to create a unattend.xml answer file using Windows System Image Manager (Windows SIM). You should already have Windows SIM installed on another computer. If not, the download link is listed above.
- Insert the media you used to install Windows 10 on your image computer into your CD-DVD drive.
- Start Windows SIM. From the menu select “Tools – Create Catalog”. You’ll be prompted for the “install.wim” file located on your media. Browse to the install.wim file in the sources directory on your disk. When the catalog is complete you’ll be ready to configure your answer file.
- I’ve attached a sample unattend.xml file for reference. Open the file with Windows SIM and take a look at some of the settings I’ve configured.
In my unattend.xml file you’ll see:
<ComputerName>*</ComputerName>
Open in new window
This will allow sysprep to provide a random name for the computer after sysprep.
<CopyProfile>true</CopyProfile>
Open in new window
This tells sysprep to copy the configured profile you’ve created to the default profile.
<SkipRearm>0</SkipRearm>
Open in new window
Set SkipRearm to 1 while customizing your computer.
Before running the Sysprep command the final time before deploying an image, rearm the computer by setting the SkipRearm setting to 0. This resets the Activation grace-period timer.
<PreferredPlan>your.guid</PreferredPlan>
Open in new window
This specifies the default power plan for your image. Update the unattend.xml file with the guid of the power plan you retrieved earlier.
<DisableAntiSpyware>true</DisableAntiSpyware>
Open in new window
Setting this to True will disable Windows Defender. Set this to False if you are not deploying your own antivirus program.
<MachineObjectOU>OU=Re-Imaged,OU=Computers,DC=your,DC=domain,DC=com</MachineObjectOU>
Open in new window
You must specify an OU to add the computers to otherwise they will not be added to the domain.
<DoNotCleanUpNonPresentDevices>true</DoNotCleanUpNonPresentDevices>
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
Open in new window
When set to True, this tells sysprep not to remove installed hardware from the image during sysprep. This should be the case when distributing the image to the same model computer. If you would like to create a clean sysprep image, meaning you are able to install the image on any computer, no matter the hardware, the above should be set to False.
The other thing regarding the unattend.xml, you need to create a local user during the sysprep process. When you install Windows 10 (using the disk) you’re prompted to create a local user. This process still occurs when using an attend.xml file and sysprep. In the answer file I create a local user named TempUser. TempUser gets deleted when the laptop first boots up to Windows logon screen. The sole purpose of TempUser is to hide the prompt to create a local user after sysprep runs.
Customize the answer file to meet your image needs. After you’ve completed the unattend.xml file, copy the file to C:\Windows\System32\Syspre
Customize SetupComplete.cmd
On your image laptop, browse to the C:\Windows\setup\Scripts directory your created earlier. Open SetupComplete.cmd for editing. As I said earlier, commands placed in this file will run just before you are presented with the Windows logon screen.
To delete the previously created TempUser account, add the following command to SetupComplete.cmd:
net user TempUser /delete
Open in new window
To enable the local Administrator account, add the following command to SetupComplete.cmd:
net user Administrator /active:yes
Open in new window
Even though you may have enabled the administrator account on the imaged laptop before running sysprep, it will be disabled again.
Delete the Domain Users group from the local Administrators and Users groups using the above commands.
net localgroup Administrators "Domain\Domain Users" /delete
net localgroup Users "Domain\Domain Users" /delete
Open in new window
To delete the unattend.xml file, add the following command to SetupComplete.cmd:
del C:\Windows\System32\Sysprep\unattend.xml
Open in new window
Even though the passwords you enter in the xml file are encrypted, you’ll feel better knowing the file is not there. I’ve attached a sample SetupComplete.cmd file for reference. You may add whatever commands you need to run here in this file. Save the file when finished.
Note: One change I’ve noticed from Windows 8.1 to Windows 10 is that you will
not
be able to add domain users/groups to local groups through SetupComplete.cmd. If you find otherwise Let me know.
Run Sysprep
You should now be ready to run sysprep on the computer.
Note: I highly recommend that you take an image of your image computer before you run sysprep. Things DO go wrong and being able to get back to a pre-sysprep state will save you a lot of time and heart-ache.
From within the configured profile you’ve created, open a command prompt. Navigate to C:\Windows\System32\Syspre
sysprep.exe /generalize /oobe /shutdown /unattend:unattend.xml
Open in new window
The computer will shut down after sysprep has finished.
Take An Image
Now it’s time to take an image of the hard drive. Everyone has their own way of doing this. I use Symantec Ghost as it takes an image of the whole drive. I’ve tested ImageX and found it to have it drawbacks. The main reason I choose not to use it is because we use two partitions in our image. The C: partition for the OS and the D: partition for the users’ data. You cannot take a disk image with ImageX. You have to do each partition individually. The same goes for when applying the image. I ghost the hard drive and have our completed image.
I’ve attached a zip containing the files discussed in this guide.
I hope this guide is helpful and puts you in the right direction for a successful sysprep image. You’re welcome to post messages for your own tricks or tips that you think will be beneficial to the Windows 10 sysprep community!
Good luck!
Ivano
GuideFiles.zip
