what changed for Build and Capture in Configuration Manager
Applies to: Configuration Manager 2509 update rollup (KB36949461) and later; Windows 11 24H2 and later (build 26100 and later); Windows Server 2025
If your Configuration Manager Build and Capture task sequence suddenly stops with the message below, you are in the right place. A process that worked for years now fails, and it is natural to ask what broke.
Sysprep under SYSTEM token is not supported for Windows build 26100 or later.
Nothing is broken. This is intentional. In this post I explain what changed, why it protects the devices you deploy, and how to get a working custom image with the tools you already have.
Configuration Manager still gives you a toolset and a framework to build a custom image with a working end result. The workflow changes. The outcome doesn’t.
In short
- Windows doesn’t support running Sysprep as the SYSTEM account. Task sequence steps run as SYSTEM.
- Configuration Manager now follows that supportability statement. Sysprep needs a signed-in user with a user profile.
- A single unattended task sequence that builds, runs Sysprep and captures can no longer work, because a suer is not signed in.
- Our recommended and supported path based on these changes is using a capture media started from the signed-in reference computer. If you prefer to start the capture from Software Center, you can split build and capture into two task sequences.
- The Autopilot for Existing Devices template is affected too. This task sequence doesn't result in creating an image but still requires changes to succeed. These suggested changes are included at the end of this post.
What you will see
When running a build and capture task sequence, it stops in the Capture the Reference Machine group, the Prepare OS action (Prepare Windows for Capture step), with error code 16389. To confirm the cause, look for the message above in smsts.log on the reference computer.
smsts.log in CMTrace showing the “Sysprep under SYSTEM token is not supported” line
What changed
The Windows documentation lists this under unsupported Sysprep scenarios: Sysprep cannot be run under the context of a System account, for example through Task Scheduler or PsExec. Task sequence steps run as SYSTEM, which means the built-in Prepare Windows for Capture step ran Sysprep in an unsupported context. For many Windows version, this happened to work but was never explicitly supported by Windows itself.
The Configuration Manager product group has changed the product to be in line with the Windows statement. The change was released in the update rollup for version 2509 (KB36949461) in April 2026 and is included in all newer versions. That rollup has since been replaced by KB 37864969, so installing the latest update rollup for your version covers it.
Sysprep now requires a user profile, and that disables workflows that use a single task sequence for everything.
Why this isn’t extra complexity
The goal is not to make image creation harder. It is to make sure the image you capture works on every device you deploy it to.
Windows 11 24H2 and later depend on XAML AppX packages (MicrosoftWindows.Client.CBS, Microsoft.UI.Xaml.CBS and MicrosoftWindows.Client.Core). When Sysprep runs as SYSTEM, the registration of these packages is skipped. This causes the captured image to look healthy, but devices deployed from it can show:
- A “Why did my PC restart?” dialog during Windows setup. The release notes of 2509 KB36949461 update rollup list this as the visible symptom for images captured with Build and Capture on Windows 11 24H2.
- A black screen at sign-in, because explorer.exe crashes.
- The Settings app, or other modern apps fail to render their interface.
- The Start menu and other XAML-based apps close unexpectedly or fail to start.
These symptoms can appear right after the first sign-in, or later when a Windows update touches one of the packages. They affect every device deployed from the image, and nothing in the capture process points back to Sysprep, which makes them hard to diagnose. A clear message at capture time is better than finding the problem on thousands of devices. The article Fix black screen after running Sysprep as system on Windows 11 or Windows Server 2025 describes the symptoms in detail.
Good to know: Re-registering the packages with Add-AppxPackage -Register can repair affected packages but it doesn’t give you a supported image. If Sysprep did not run as SYSTEM and you see the same symptoms, KB5072911 describes other possible causes for app issues.
What is affected
|
Scenario |
What to do |
|
Build and Capture task sequence on Windows 11 24H2 or later |
The task sequence stops with the error above. Use capture media (recommended) or split build and capture. |
|
Existing standalone capture media |
Re-create the media with the 2509 update rollup (KB36949461) or a newer version. |
|
Autopilot for Existing Devices template (no image is captured) |
It runs Sysprep from the task sequence. Change the task sequence as described in the Autopilot section. |
|
Other tools that run Sysprep as SYSTEM, for example third-party or VM automation |
Unsupported by Windows. Ask the vendor to change their process. |
Option 1 (recommended): capture media
Capture media is the easiest way to create a custom image. You start it from the signed-in reference computer, so Sysprep runs with a user profile, and you don’t need to maintain a second task sequence. Capture media requires no client registration and can be initiated directly from the media.
Step 1: Prepare the reference computer
- Build the reference computer (OS, updates, applications) with your Build task sequence, without the capture steps. The Build task sequence settings in Option 2 below (empty Administrator password, workgroup, client installation properties) apply here too.
- Keep it in a workgroup. The Sysprep tool runs only if the PC is a member of a workgroup, not a domain.
- Sign in with a local account so that a full user profile is loaded.
Step 2: Prepare the device with PrepareOS.ps1
Sysprep can fail for reasons that have nothing to do with the account it runs under. A Windows 11 image capture can also stop because the device still contains one of a few known showstoppers.
That is the purpose of PrepareOS.ps1: it makes a Windows device ready for Sysprep by finding and removing these showstoppers ahead of time, so you find out before the capture and not halfway through it. It also writes a CMTrace-compatible log. Download the package from the PowerShell Gallery, extract it, and copy PrepareOS.ps1 to the reference computer. Then run it in an elevated Windows PowerShell 5.1 window, while signed in on the reference computer:
PrepareOS.ps1 -SkipSysprep -LogPath C:\Windows\Temp\PrepareOS.log
Always use -SkipSysprep with capture media. If you run the script without it, the script asks Run Sysprep now?. Answer N, because Sysprep must run separately under the logged-on user context. Your Capture Media will accomplish this task.
[Screenshot: PrepareOS.ps1 running in an elevated PowerShell window]
PrepareOS.ps addressed the most common showstoppers. Each one would show up in setupact.log (C:\Windows\System32\Sysprep\Panther) or smsts.log.
The article Errors when capturing Windows 11 image by using capture media in Configuration Manager describes them in detail.
Step 3: Create and run the capture media
- In the Configuration Manager console, go to Software Library > Operating Systems > Task Sequences and select Create Task Sequence Media.
- Select Capture media, choose a USB drive or ISO, select the boot image and distribution point, and finish the wizard. If you used standalone capture media in the past, re-create it to pick up the change that accounts for Sysprep no longer running as the Local System account.
- On the signed-in reference computer, start the media from within Windows (TSMBAutoRun.exe) and complete the Capture wizard, including the location to save the WIM.
- The computer restarts into Windows PE and captures the image.
- Import the resulting WIM into Configuration Manager as usual.
[Screenshot: Task Sequence Capture wizard on the reference computer]
Tip: If Sysprep fails, you can’t run it again on the same Windows image and have to redeploy. Check the reference computer carefully before you capture.
Option 2: split Build and Capture into two task sequences
If you prefer to start the capture from Software Center, separate the build from the capture, with a manual logon in between. You split your existing Build and Capture task sequence into two. The Sysprep step stays in the capture task sequence, but it now needs the user profile that exists after the logon.
Step 1: The Build Sequence
Duplicate your existing Build and Capture task sequence twice. The first copy becomes the Build Sequence. The second copy becomes the Capture Sequence in Step 3. Make the following changes to the first copy.
1.1 Set the Administrator password to empty
- Open the Apply Windows Settings step.
- Set the local Administrator password to empty (blank).
The purpose of the empty password:
- When the Build Sequence finishes and the computer restarts into the full OS, you sign in to the built-in Administrator account. With an empty password, a single click is enough.
- Windows security policy prevents domain authentication with blank-password accounts, so the computer stays in a workgroup. That is the intended state for a reference image that hasn’t been generalized yet.
Note: The empty password is a deliberate choice, not a shortcut. The generalize pass wipes it anyway. As soon as you select Apply, the field appears to have a protected value set. This is normal.
[Screenshot: Apply Windows Settings step with the Administrator password set]
1.2 Verify the network settings
- Open the Apply Network Settings step.
- Confirm that it is configured to Join a workgroup, not a domain, for example WORKGROUP.
1.3 Configure the Configuration Manager client installation
- Open the step Setup Windows and Configuration Manager.
- To make sure Install Software Updates and Install Applications succeed, provide the SMSMP parameter that points to your management point, and increase the client cache size. For example:
SMSMP=FOR-PS1MP1.fourthcoffee.com SMSCACHESIZE=20480
1.4 Remove the capture steps
Disable or remove the capture-related steps, or the group that contains them:
- Prepare Windows for Capture
- Prepare ConfigMgr Client for Capture
- Capture Operating System Image
This task sequence now only builds. It does not capture.
Step 2: The manual handoff
- Let the Build Sequence complete and the computer restart.
- Windows boots to the logon screen of the local Administrator account. Sign in. The password is empty, so a single click is enough.
- The reference computer is now fully built, with its applications, drivers and updates, but it has not been generalized.
- Inspect the reference computer before you commit to a capture.
Step 3: The Capture Sequence
3.1 Convert the second copy into the Capture task sequence
Use the second copy of the original task sequence as the Capture task sequence. Remove or disable all build-related steps, such as Apply Operating System, Apply Drivers and Install Applications. What remains is the capture logic.
3.2 Add the “Prepare OS for Capture” PowerShell step
- In the Capture the Reference Machine group, add a new step of type Run PowerShell Script.
- Position it before the Prepare Configuration Manager Client action.
- Name the step Prepare OS for Capture.
- Select Enter a PowerShell script, select Edit Script…, and paste the content of PrepareOS.ps1 into the editor.
- Add the following parameters to the step:
-SkipSCCM -SkipSysprep -LogPath %_SMSTSLogPath%\PrepareOSforCapture.log
- Set the PowerShell execution policy to Bypass.
[Screenshot: The Capture task sequence with the Prepare OS for Capture step]
3.3 What PrepareOS.ps1 does in the task sequence
PrepareOS.ps1 makes the device ready for Sysprep by removing the known showstoppers before Sysprep runs. These are the same ones described in Option 1, Step 2. Inside the task sequence it works through these tasks:
|
Task |
Why it matters |
|
BitLocker decryption |
Sysprep can’t generalize an encrypted OS volume. |
|
AppX clean-up |
Removes packages that are installed for a user but not provisioned for all users. |
|
DISM health checks |
Detects component store problems before they stop the generalize pass. |
|
GPT attribute remediation |
Makes sure the OS partition gets a drive letter in Windows PE. |
|
Configuration Manager client removal |
Keeps the image clean for redeployment. |
The script writes a CMTrace-compatible log and shows its progress in the task sequence progress UI.
Why this is a separate step: the preparation can safely run as Local System in the task sequence. Only Sysprep needs the user context, which is why the script never starts Sysprep in this scenario (-SkipSysprep). Since version 1.10, the script detects a task sequence and skips the steps that don't belong there on its own, but passing the parameters keeps the step explicit.
3.4 Deploy and run the Capture Sequence
- Deploy the Capture task sequence as Available to a collection that contains the reference computer.
- Set the deployment setting to Only Configuration Manager clients.
- On the reference computer, start the task sequence from Software Center.
- The task sequence generalizes the image and captures it to the location you specified in the Capture the Reference Machine step.
- Import the resulting WIM into Configuration Manager as usual.
3.5 HTTPS and Enhanced HTTP
- Enhanced HTTP: approve the reference computer in the Configuration Manager console before it can receive the Capture task sequence and show it in Software Center.
- HTTPS-only environments: add a client certificate import action and make sure the certificate chain can be verified without Active Directory domain membership.
- The client must register successfully before the task sequence becomes visible in Software Center. Capture media (Option 1) doesn’t have this requirement.
Autopilot for Existing Devices
The Autopilot for Existing Devices template uses Configuration Manager to deploy a Windows image and then hand the device over to Autopilot for provisioning. This is a separate workflow from image creation. In the default template, Sysprep runs as part of the task sequence to generalize the OS before the Autopilot OOBE experience, and that is the step that now fails (no user profile created which is needed to run as a user over local system account).
Which of the following two options fits depends on your environment.
Option A: remove Sysprep entirely
If your Autopilot workflow deploys a clean, already generalized Windows image and doesn’t need to generalize it again on the target computer, you can remove the Sysprep step. Autopilot doesn’t require a fresh generalize pass. It needs the computer to boot into OOBE, which a pre-generalized image already provides. Make these changes to the task sequence:
- Disable the entire Setup Operating System group.
- In the Prepare device for Windows Autopilot group, disable or remove Prepare Configuration Manager Client and Prepare Windows for Capture.
- Add a new Run Command Line step named Remove existing Unattend.xml to enable OOBE with this command:
cmd.exe /c del %OSDTargetSystemRoot%\panther\unattend\unattend.xml
- Add a second Run Command Line step named Reboot to continue with Out of Box Experience with this command:
wpeutil.exe reboot
[Screenshot: The modified Autopilot task sequence: Setup Operating System disabled, new steps added]
[Screenshot: Remove existing Unattend.xml to enable OOBE: command line details]
[Screenshot: Reboot to continue with Out of Box Experience: wpeutil reboot]
Tip: The workflow is still in Windows PE at this point. Don’t use any of the built-in task sequence restart actions. If you prefer to shut down the device and ship it to the end user, use wpeutil.exe shutdown instead.
Optional: You can add a condition to the Unattend.xml deletion step so that it only runs if the file %OSDTargetSystemRoot%\panther\unattend\unattend.xml exists.
Option B: deploy a pre-generalized corporate image
If your Autopilot workflow relies on a custom corporate image with business-critical applications pre-installed, rather than deploying them through Intune during provisioning, you need an already generalized image before deployment. Create it with the capture process described earlier in this post (capture media or split Build and Capture). The result is a generalized reference image that already contains your applications. Deploy that captured image with the Autopilot for Existing Devices task sequence. Because the image is already generalized, the task sequence doesn’t need a Sysprep step at all. You still need the Option A changes, because the Unattend.xml removal and the wpeutil reboot steps are required in both scenarios.
Wrapping up
- The error is intended. Configuration Manager now matches the Windows supportability statement.
- Sysprep needs a user profile, so build, Sysprep and capture can’t be one unattended task sequence.
- Capture media from a signed-in reference computer is the easiest supported way to create a custom image.
- Re-create existing standalone capture media and review your Autopilot for Existing Devices task sequence.
Thanks for reading. If you have questions or run into something this post doesn’t cover, leave a comment below.
Further reading
- Update rollup for Microsoft Configuration Manager version 2509 (KB36949461): the release that contains the change, and the “Why did my PC restart” fix.
- Update rollup KB 37864969: the rollup that replaces KB36949461.
- Sysprep (System Preparation) Overview, Unsupported Scenarios: the Windows supportability statement for Sysprep.
- Fix black screen after running Sysprep as system on Windows 11 or Windows Server 2025: symptoms, cause and repair steps for images captured the unsupported way.
- KB5072911: Explorer, the Start menu, and other XAML-dependent apps might not start or close unexpectedly on some enterprise devices: other possible causes of the same symptoms.
- Create capture media: the Configuration Manager documentation for capture media.
- Create a task sequence to capture an OS: the Configuration Manager documentation for the task sequence method.
- Errors when capturing Windows 11 image by using capture media in Configuration Manager: other capture errors, their causes and solutions.
- PrepareOS.ps1 on the PowerShell Gallery: the sample script used in this post. PrepareOS.ps1 is a community sample and not an officially supported Microsoft product. Test it in a non-production environment first.
Updated Nov 30, 2026
Version 2.0Wilhelm_J_Kocher
Microsoft
Joined March 20, 2019
Configuration Manager Blog
Follow this blog board to get notified when there's new activity