HomeNewsletterCommunityMVP FeedToolsArchiveBlogToday's NewsAboutServicesQuick Links Subscribe free
← Back to Blog
Windows 11 Windows 11WinREWindows Update0x80070643Recovery PartitiondiskpartreagentcIntunePowerShellPatching

The WinRE partition is too small: 0x80070643 and the recovery-partition resize you cannot avoid

IA
Imran Awan
21 August 2026

A security update fails. The error is 0x80070643. You do what any sane administrator does: you check the Windows Update service, you clear the SoftwareDistribution folder, you run the troubleshooter, you re-run the scan. Nothing changes. The update fails again, next month it fails again, and the device sits in your compliance report as permanently behind.

The problem is not Windows Update. The problem is disk geometry. Specifically, it is a partition most administrators have never opened, never sized, and never thought about since the day the OEM shipped the machine. This post explains what that partition is, why a security update needs free space inside it, how to find out how many of your devices are affected, and what the documented repair actually does to the disk. The repair involves deleting and recreating a partition on a running machine, so the risk section is not decoration.

The short version

Windows Recovery Environment (WinRE) updates are staged into the recovery partition, and Microsoft's Windows Recovery Environment update articles state the update "requires 250 MB of free space in the recovery partition to install successfully". Devices whose recovery partition is too small fail the update, and the failure surfaces as a generic Windows Update install error rather than anything mentioning disks. The documented repair is reagentc /disable, a diskpart shrink-delete-recreate sequence, then reagentc /enable -- which means deleting a partition on a live machine. Measure your fleet with a read-only detection pass first, because Microsoft documents three different free-space figures and there is no Group Policy or Intune setting that fixes this.

The problem: an update that fails with a code that tells you nothing

Every few months Microsoft ships a Windows Recovery Environment update. It is a small, separate item in Windows Update, with a title like "Windows Recovery Environment update for Windows 10, version 21H2 and 22H2". On some devices it installs in seconds. On others it fails, and keeps failing, forever.

What is WinRE, in plain English? Windows Recovery Environment (WinRE) is a tiny, separate copy of Windows that boots when the main installation cannot. Microsoft describes it as "a recovery environment that can repair common causes of unbootable operating systems", based on Windows Preinstallation Environment (Windows PE). It is what you land in when you hold Shift and click Restart, and what starts automatically after two consecutive failed boot attempts. Startup Repair, Reset this PC, System Restore and the command prompt you use to fix a broken boot record all live inside it.

The failure code you see is 0x80070643. That is an HRESULT built from the Win32 facility, wrapping Win32 error 0x643, which is 1603 in decimal. Microsoft's Windows Installer error reference documents 1603 as ERROR_INSTALL_FAILURE, described simply as "A fatal error occurred during installation." That is the whole message. It says an install failed. It does not say anything about partitions, disks, or recovery.

Gotcha: the code is generic, and the current KB articles no longer name it. Microsoft's known-issue text for the January 2024 WinRE update named 0x80070643 explicitly. Today's Windows Recovery Environment update articles document the free-space requirement instead, and current builds tend to simply not offer the update when free space is short. So 0x80070643 is a strong signal, not a certainty: it is the generic install-failure surface, and other causes exist. Confirm with the event log before you go anywhere near diskpart.

The reliable signal is in the event log, and Microsoft documents it. Its resize guidance states that when this happens you get "a system event with an ID of 4502 triggered in C:\Windows\System32\winevt\logs\system.evtx", with details showing "Windows Recovery Environment servicing failed" and an ErrorPhase of 2. Here is what to look for.

Event Viewer - Windows Logs > System
Level        : Error
Source       : WinREAgent
Event ID     : 4502
Computer     : CONTOSO-W11-0042
Description  : Windows Recovery Environment servicing failed.
ErrorPhase   : 2
Illustrative panel, shaped from Microsoft's documented description of the failure event. The companion script counts real 4502 events on the device.

The mirror image of that event is ID 4501. Microsoft's article on verifying the installed WinRE version tells you to search the System log for WinREAgent entries and look for "Event ID: 4501 Servicing succeeded", which carries the text "The Windows Recovery Environment version is now:" followed by a version number. So the pair is simple: 4501 means the recovery image was replaced, 4502 means it was not.

Before anything else, ask the device what it thinks its own recovery configuration is. ReAgentc.exe is the in-box tool for that, and /info is the read-only option. Read the output top to bottom: status tells you whether WinRE is switched on at all, location tells you which partition holds it, and the version tells you how current the image is.

PowerShell - run elevated
reagentc /info # Real output from a Windows 11 25H2 device, build 26200.9168. Identifiers replaced. Windows Recovery Environment (Windows RE) and system reset configuration Information: Windows RE status: Enabled Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE Boot Configuration Data (BCD) identifier: aaaaaaaa-0b0b-1c1c-2d2d-333333333333 Recovery image location: Recovery image index: 0 Custom image location: Custom image index: 0 Windows RE Version: 10.0.26100.9168 REAGENTC.EXE: Operation Successful. # HEALTHY: status Enabled, and a location naming a harddisk and a partition. # BROKEN: status Disabled, or an empty location. Both mean WinRE is not on a # recovery partition, which is a different problem to a full one. # NOTE: without elevation this command fails outright. Always run it elevated.

Tip: a device with no recovery environment does not need the update. Microsoft's guidance is explicit that if a Windows device has no recovery environment configured, it does not need the WinRE update and the error can be ignored. That is a genuine exclusion for your fleet report, not a workaround -- but be sure it is deliberate, because a device with WinRE disabled has also lost Startup Repair and Reset this PC.

Why it happens: WinRE lives in its own partition, and the update replaces the whole image

To understand the free-space requirement you need three facts about how WinRE is stored and serviced. Take them in order.

Fact one: WinRE is a file, and it is deliberately not on your C drive. The recovery environment ships as a single Windows Imaging Format file, winre.wim. Microsoft's WinRE technical reference describes the flow: Windows Setup first places winre.wim in the Windows partition under \Windows\System32\Recovery, and then during the specialize configuration pass copies it into the recovery tools partition "so that the device can boot to the recovery tools even if there's a problem with the Windows partition". The same page states the recovery tools must be in a separate partition so users "can use WinRE even if the Windows partition is encrypted with Windows BitLocker Drive Encryption". A recovery tool stored on the volume it exists to recover is not a recovery tool.

Fact two: that file is big. Microsoft's UEFI/GPT partition guidance states that "the recovery image, winre.wim, is typically between 500-700MB, depending on what drivers, languages, and customizations you add", and adds that "the file system itself can take up additional space. For example, NTFS may reserve 5-15MB or more on a 750MB partition."

Fact three, and this is the one that causes the failure: WinRE is not patched in place. Microsoft's technical reference is unambiguous. "Unlike the normal OS update process, updates for Windows RE don't directly service the on-disk Windows RE image (winre.wim). Instead, a newer version of the Windows RE image replaces the existing one", with boot-critical drivers from the running OS and any customizations under \Sources\Recovery injected or migrated into the new image.

Put those together and the arithmetic is obvious. To replace a 600 MB image you need somewhere to put the new 600 MB image before you delete the old one. That somewhere is the recovery partition, and if it does not have room, the swap cannot happen. This is the whole bug.

Here is the chain, from trigger to failure, in order:

  1. Windows Update (service wuauserv) offers a Windows Recovery Environment update, or a monthly cumulative update that carries WinRE servicing. Microsoft moved to servicing WinRE through the monthly cumulative update from 27 June 2023, for devices getting updates from Windows Update or Windows Server Update Services (WSUS).
  2. The servicing component, which logs under the name WinREAgent, builds a new recovery image and stages it toward the recovery partition, writing progress into %WINDIR%\Logs\WinREAgent\setupact.log.
  3. Deployment Image Servicing and Management (DISM) does the image work. You can see its calls interleaved in the same log.
  4. If the staging succeeds, ReAgentc.exe repoints the configuration at the new image and the System log gets a WinREAgent event 4501.
  5. If there is not enough free space, staging fails. Windows Update reports a generic install failure. The System log gets WinREAgent event 4502 with ErrorPhase 2.

Microsoft also documents what Windows tries to do about a partition that is too small, and this is the part that should make you cautious. The technical reference states the update process "makes every effort to reuse the existing Windows RE partition without any modification", but where the new image does not fit:

That third outcome is quietly significant: it silently ends BitLocker-compatible recovery, because the recovery image is now on the encrypted volume. Partition order on disk is therefore not cosmetic. It decides which of those three paths your device takes.

The free-space number is not one number

The brief for this post asked for "the documented free-space requirement". There is no single one. Microsoft publishes several figures in different places, for different purposes, and you should know all of them before you pick a threshold for your fleet.

Source documents for each row are linked in References.

Documented figureWhere Microsoft states itWhat it governs
250 MB freeWindows Recovery Environment update KB articles: "This update requires 250 MB of free space in the recovery partition to install successfully."Whether the WinRE servicing update can install. This is the number that causes the failure.
250 MB free (recommended)"Add an update to Windows RE": "It is recommended to have 250MB of free space in the recovery partition for WinRE updates to install successfully."The same servicing requirement, restated as engineering guidance.
Minimum 100 MB, 250 MB recommended (Windows 11); minimum 52 MB, 250 MB recommended (Windows 10)UEFI/GPT-based hard drive partitionsDeployment-time free space for the WinRE tools, "to accommodate future updates, especially with custom partition layouts".
At least 200 MB free (Windows 10 2004 and later, Windows Server 2022 and later)Disk partition requirement for using Windows RE tools on a UEFI-based computerFree space needed for WinRE to function and for backup utilities to capture the partition.
Partition at least 300 MB; 990 MB partition with 250 MB free for custom diskpart layoutsUEFI/GPT guidance and the same troubleshooting articleTotal partition size at build time, and the bare-metal-recovery minimum for manufacturers.

Gotcha: do not average these numbers, and do not pick the smallest. They answer different questions. The one that decides whether this month's update installs is 250 MB of free space, not total size. A 500 MB partition holding a 600 MB image has zero free space and will fail no matter how comfortable "500 MB" sounds. Equally, note the "Important" line in the troubleshooting article: "If Windows RE doesn't work as expected, double the specified free space for the partition." If you are sizing a golden image today, size generously; 1 GB or more of partition is cheap and partition surgery later is not.

System files and binaries in the flow

These are the actual files involved. Knowing which one does what is the difference between reading a log and guessing at it.

FileLocationRole in the flow
ReAgentc.exeC:\Windows\System32\ReAgentc.exeThe recovery configuration tool. Microsoft documents it as configuring "a Windows Recovery Environment (Windows RE) boot image and a push-button reset recovery image, and to administer recovery options and customizations". Every documented repair step calls it.
ReAgent.xmlC:\Windows\System32\Recovery\ReAgent.xmlThe state file. Holds the WinRE BCD identifier, the WinRE location (partition GUID and byte offset), the staged image location, and install state. Microsoft's own resize script reads this exact path and clears the stage location before repartitioning.
winre.wimDeployed copy in \Recovery\WindowsRE\winre.wim on the recovery partition; source copy at C:\Windows\System32\Recovery\winre.wimThe recovery environment itself. Typically 500-700 MB. Hidden and system-flagged, so attrib -h -a -s is needed to see it.
winpeshl.exeInside the mounted winre.wimThe Windows PE shell. Microsoft's version-verification script reads its file properties to determine the WinRE version.
Dism.exe and DismCore.dllC:\Windows\System32\Dism\Does the mount, package-add and image-info work during servicing. Its calls appear inside the WinREAgent log.
Boot files: BCD store, bootmgfw.efiEFI System Partition (ESP), FAT32, minimum 200 MB (512e) or 300 MB (4K native)The BCD recoverysequence entry is what actually boots WinRE. reagentc /enable writes it; reagentc /disable removes it. This is why the repair sequence brackets the disk work with those two commands.
diskpart.exeC:\Windows\System32\diskpart.exeThe partition tool used in the documented manual repair. It is also the destructive part.

Registry: there is almost nothing here, and that matters

If you have been searching for a registry key that reports WinRE health, stop. WinRE's configuration is not registry-backed. Its state lives in ReAgent.xml and in the Boot Configuration Data store. The values below are the ones a detection script legitimately reads, and they are about identifying the OS build so you can correlate it against the WinRE image version.

Shared parent key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
ValueTypeWhat it tells you
CurrentBuildREG_SZOS build number, for example 26200. Compare against the WinRE image version to see how far behind the recovery image is.
UBRREG_DWORDUpdate Build Revision, the part after the dot. Microsoft's guidance is that the WinRE image ServicePack Build should be greater than or equal to the UBR of the update you applied.
DisplayVersionREG_SZMarketing version, for example 25H2. Determines which KB article applies to the device.
EditionIDREG_SZEdition, for example Enterprise. Relevant because Intune Remediations require Enterprise, Professional or Education.
Registry Editor
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
CurrentBuild      REG_SZ     26200
UBR               REG_DWORD  0x000023d0 (9168)
DisplayVersion    REG_SZ     25H2
EditionID         REG_SZ     Enterprise
WinREVersion      (value does not exist)
Genuine read from a Windows 11 25H2 device. The first four values are real; the last line shows a value that is widely quoted online but absent here.

Do not build detection on WinREVersion. A registry value of that name under the key above is frequently cited in forum answers as the way to read the WinRE version. Microsoft's own article on verifying the installed WinRE version documents three methods -- a script that reads winpeshl.exe properties from the mounted image, the System log WinREAgent 4501 event, and reagentc /info plus Dism /Get-ImageInfo -- and none of them is a registry read. On the live Windows 11 25H2 device used for this post the value does not exist at all. Treat it as observed-and-undocumented: a detection script that keys on it will report "unknown" across your entire fleet, or worse, report a clean result because the read returned nothing.

How to verify: measure the fleet before you touch a single disk

The single most important thing in this whole topic: find out how many devices are affected before you deploy anything that modifies a partition. The remediation is destructive, and if it turns out that eleven laptops need it, eleven laptops is a helpdesk ticket, not a fleet-wide script campaign.

Step one: read the geometry on one device

Two commands give you everything. Get-Partition tells you where the recovery partition sits and how big it is; Win32_Volume tells you how much of it is free. You need both, because Get-Volume will not reliably show a partition with no drive letter.

PowerShell - run elevated
Get-Partition -DiskNumber 0 | Select-Object PartitionNumber, DriveLetter, ` @{n='SizeMB';e={[math]::Round($_.Size/1MB,0)}}, Type, Offset | Format-Table -AutoSize # Real output from the same 25H2 device. PartitionNumber DriveLetter SizeMB Type Offset --------------- ----------- ------ ---- ------ 1 260 System 1048576 2 16 Reserved 273678336 3 C 974485 Basic 290455552 4 2000 Recovery 1022112038912 Get-CimInstance Win32_Volume | Where-Object { -not $_.DriveLetter -and $_.Capacity } | Select-Object Label, @{n='CapMB';e={[math]::Round($_.Capacity/1MB,0)}}, ` @{n='FreeMB';e={[math]::Round($_.FreeSpace/1MB,0)}} | Format-Table -AutoSize Label CapMB FreeMB ----- ----- ------ WinRE_DRV 2000 1103 SYSTEM 256 217 # HEALTHY: FreeMB for the recovery volume is 1103, comfortably over 250. # BROKEN: a Recovery partition of 500-700 MB with FreeMB under 250. Very common # on devices built before the June 2023 servicing change. # ALSO CHECK: partition 4 is immediately after partition 3 (C:). That is the layout # Microsoft documents as extensible in place. Any other order is riskier.

Step two: use the read-only companion script for the fleet

Typing those commands on one machine is fine. Doing it on nine hundred is not. The companion script for this post, Get-WinRePartitionReadiness.ps1, does the whole readiness read in one pass and returns an exit code you can use as an Intune detection result. It is deliberately and strictly read-only: it never calls reagentc /disable, never invokes diskpart, and contains no partition-modifying cmdlet at all.

It reports the OS build, WinRE status and image version, the recovery partition's disk and partition index, its capacity and free space, whether the partition sits immediately after the OS partition, the ReAgent.xml stage state, the count of WinREAgent 4501 and 4502 events, and which WinRE log files exist. It ends in one of three words: READY, NOT-READY, or READ-FAILED.

Tip: READ-FAILED is a separate verdict on purpose. The most dangerous outcome in fleet detection is a script that reports "compliant" because a read silently returned nothing. If any read fails -- no elevation, missing Storage module, unparseable ReAgent.xml, an event log query that errors for a real reason -- the script aborts, prints why, and refuses to emit a readiness figure. Use -AsJson for machine-readable output; Intune Remediations caps script output at 2,048 characters, and the JSON object fits comfortably.

Step three: log files and what to grep for

When a device says NOT-READY and you want to know what the last servicing attempt actually did, these are the files. All five were confirmed present on the live device used for this post.

Log pathSearch forHow to read it
%WINDIR%\Logs\WinREAgent\setupact.logwinre.wim, ImageFilePath, ErrorThe primary WinRE servicing log. Healthy lines look like Input parameters: ImageFilePath: \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE\winre.wim. A broken run shows the same staging attempt followed by a failure and no matching success.
%WINDIR%\Logs\WinREAgent\setuperr.logany content at allErrors only. An empty or tiny file is good news; a large one is your starting point.
%WINDIR%\Logs\ReAgent\ReAgent.logExiting command line, last errorEvery ReAgentc.exe invocation, with return values. Healthy: -----Exiting command line: "C:\WINDOWS\System32\reagentc.exe" /info, Error: 0-----. Broken: a non-zero Error, or a last error: 0x2 style code on a config read.
%WINDIR%\Logs\CBS\CBS.logthe KB number, Package_for_KBComponent servicing. Use it to confirm the update package was even offered and staged before WinRE work began.
%WINDIR%\Logs\DISM\dism.logMount, winreThe image operations themselves. WinRE servicing initialises DISM logging here, so mount and commit failures land in this file.

There is also a working directory, %SYSTEMDRIVE%\$WinREAgent, that appears during servicing and is cleaned up afterwards. If it is present on an idle device, servicing did not finish tidily. It was absent on the test device, which is the expected state.

Step four: services and scheduled tasks

Nothing here needs configuring, but knowing the expected state saves you chasing the wrong component.

ComponentNameExpected state
Servicewuauserv (Windows Update)Startup type Manual, running on demand. This is what offers the WinRE update.
ServiceTrustedInstaller (Windows Modules Installer)Manual or Automatic; runs during servicing. Writes CBS.log.
Servicebits (Background Intelligent Transfer Service)Automatic, running. Downloads the payload.
Scheduled task\Microsoft\Windows\WindowsUpdate\Scheduled StartReady. Triggers update scans.
Scheduled task\Microsoft\Windows\RecoveryEnvironment\VerifyWinREReady. Observed-and-undocumented -- see the warning below.
Scheduled task\Microsoft\Windows\Setup\SetupRecoveryDataTaskReady. Observed-and-undocumented.

Gotcha: two of those tasks are undocumented. VerifyWinRE and SetupRecoveryDataTask were both read from a live Windows 11 25H2 device and are named here because they exist and they are obviously relevant. Microsoft does not document either one, so their triggers, behaviour and even their existence can change in any update. Report them, do not depend on them, and never make a detection script fail because one of them is missing.

Step five: fleet detection through Intune

Intune has no setting for this. Say that out loud before you go looking for one. There is no Settings Catalog entry, no Configuration Service Provider (CSP) node, and no Group Policy object that sizes or repairs a recovery partition. The Recovery CSP exists and it covers real WinRE functionality -- pre-configured Wi-Fi credentials for the recovery environment, quick machine recovery, whether WinRE may reuse Wi-Fi profiles saved in Windows -- but partition geometry is not among its nodes. Partition work happens through diskpart and reagentc, which means script deployment, full stop.

This is script-only. There is no policy safety net. Because there is no CSP and no GPO, there is nothing to scope, no "not applicable" state, and no reporting surface that understands what a recovery partition is. Every guardrail you get is a guardrail you build: a detection-only phase first, tight assignment groups, and a rollback plan. If you are used to shipping a Settings Catalog profile and watching a compliance number, this will feel uncomfortably manual, and it should.

The right home for the read-only detection pass is Intune Remediations. Deploy the companion script as a detection script with no remediation script attached, and you get a fleet-wide count without a single write operation.

intune.microsoft.comDevicesManage devicesScripts and remediations
  1. Sign in to the Microsoft Intune admin center at intune.microsoft.com.
  2. Go to Devices > Manage devices > Scripts and remediations. Note that this node was previously called Proactive Remediations.
  3. Select the Remediations tab, then choose Create script package.
  4. On Basics, give it a name such as Detect - WinRE recovery partition readiness and a description. Publisher defaults to your name.
  5. On Settings, select the folder icon next to Detection script file and upload Get-WinRePartitionReadiness.ps1. Leave Remediation script file empty for the detection-only phase.
  6. Set Run this script using the logged-on credentials to No. The script needs administrator rights, so it must run in system context.
  7. Set Enforce script signature check to No unless your script is signed and the certificate is in the device Trusted Publishers store.
  8. Set Run script in 64-bit PowerShell to Yes. The Storage module cmdlets behave correctly there.
  9. Select Next, apply any Scope tags, then on Assignments pick a pilot device group. Do not assign to All Devices on the first pass.
  10. Set the Schedule to Daily. Complete Review + create.
  11. After a day, return to the script package and select Device status, then use Export to pull the output as a CSV. Devices returning exit code 1 with the word NOT-READY are your affected population.

Two prerequisites, both documented. Devices must be Microsoft Entra joined or Microsoft Entra hybrid joined and MDM-enrolled running Windows Enterprise, Professional or Education, or co-managed. Licensing requires Windows Enterprise E3 or E5, Windows Education A3 or A5, or Windows Virtual Desktop Access per user. Also remember the detection contract: exit code 1 means the issue was found, and any other exit code -- including an empty output -- is read as "issue not found".

Group Policy: no setting for this, but one relevant trap

There is no Group Policy path that sizes a recovery partition, because there is no policy-configurable setting behind it. What Group Policy can do to WinRE is break it, and Microsoft documents exactly one such case. If the security option blocking Microsoft accounts is set to "User can't add or log with Microsoft account", a System Restore attempt inside WinRE fails with a message claiming there are no administrator accounts on the PC.

gpedit.mscComputer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options
  1. Open the Group Policy Management Editor on a domain controller, or gpedit.msc for local policy.
  2. Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options.
  3. Find Accounts: Block Microsoft accounts.
  4. If it is set to Users can't add or log on with Microsoft accounts, you have this trap. Microsoft's documented workarounds are to avoid that value, or to set the MDM policy Security/RecoveryEnvironmentAuthentication to 2.
  5. Run gpupdate /force on a test device, then verify by booting to WinRE and attempting System Restore.

The fix: the documented resize, and why you should not type it by hand

Microsoft's guidance for manually resizing the partition is the reference for this section. Read the sequence before you read the commands, because the shape of it is what carries the risk.

  1. Turn WinRE off with reagentc /disable. This moves winre.wim back to C:\Windows\System32\Recovery and removes the boot entry. For the duration of the next steps, the device has no recovery environment.
  2. Shrink the OS partition by 250 MB to free up space.
  3. Delete the existing recovery partition.
  4. Create a new, larger partition with the correct type identifier and format it NTFS.
  5. Turn WinRE back on with reagentc /enable, which stages the image into the new partition and rewrites the boot entry.

Step three is the one to sit with. You are deleting a partition on a running production machine, and between steps one and five the device cannot boot to recovery. Here is the documented command sequence, with what each line does.

Command Prompt - elevated - DESTRUCTIVE, do not paste blind
reagentc /info # Read first. Note the harddisk and partition numbers in the location string. reagentc /disable # WinRE is now OFF. The device has no recovery environment until /enable succeeds. diskpart list disk # An asterisk in the Gpt column means GPT. No asterisk means MBR. This changes step 9. sel disk<OS disk index> list part sel part<OS partition index> shrink desired=250 minimum=250 # Frees 250 MB at the end of the OS partition. Fails if the volume cannot shrink. sel part<WinRE partition index> delete partition override # THIS IS THE DESTRUCTIVE LINE. Verify the selected partition twice before running it. create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac gpt attributes =0x8000000000000001 # GPT disks only. The id is the documented recovery-partition Type ID. # On MBR disks instead: create partition primary id=27 format quick fs=ntfs label="Windows RE tools" # On MBR disks, follow the format with: set id=27 list vol exit reagentc /enable # Rebuilds the boot entry and stages winre.wim into the new partition. reagentc /info # HEALTHY: status Enabled and a location pointing at the NEW partition index. # BROKEN: "Windows RE image was not found" or status Disabled. The device now has # no recovery environment and needs hands-on repair.

This sequence deletes a partition on a live machine. Treat it accordingly. Between reagentc /disable and a successful reagentc /enable the device has no recovery environment: no Startup Repair, no Reset this PC, no BitLocker recovery path through WinRE. If the shrink fails, or the create fails, or the machine loses power mid-sequence, you own a manual repair. Microsoft's own note is that if creation failed or you do not want to extend the partition, run reagentc /enable to re-enable WinRE. Three hard rules: reboot the device first so any pending partition operations are finalised, verify BitLocker state and confirm you can retrieve the recovery key before you start, and never run this unattended at fleet scale without a pilot ring you are willing to rebuild.

Use Microsoft's script, not your own

Do not hand-roll this. Microsoft publishes sample scripts for exactly this job, and they handle the cases a hand-typed diskpart session will not.

Cite them, download them from Microsoft, read them, and test them. Do not paste them into a post like this one and call them your own -- and do not run any third-party rewrite of them without diffing it against the original.

What you can actually configure through Intune for WinRE

Since there is no partition setting, here is the WinRE surface Intune does give you, and it is worth having: quick machine recovery. Available on Windows 11 version 24H2 build 26100.4700 or later, it uses "a secure and connected Windows Recovery Environment (WinRE) to scan Windows Update for remediation options" so devices can recover from boot failures without a technician. It is configured through the Recovery CSP, and it is disabled by default on enterprise-managed devices.

intune.microsoft.comDevicesManage devicesConfigurationCreate > New policy
  1. In the Intune admin center, go to Devices > Manage devices > Configuration.
  2. Select Create > New policy. Choose Platform Windows 10 and later and Profile type Settings catalog.
  3. Name the profile, for example WinRE - quick machine recovery, then select Next.
  4. On Configuration settings, select Add settings and search the picker for Recovery, which surfaces the Recovery CSP settings.
  5. Enable cloud remediation, and optionally auto remediation with a scan interval. The underlying CSP node is documented under Recovery CSP as QuickMachineRecovery.
  6. Assign to a pilot group and complete Review + create.
  7. Verify on a device with reagentc.exe /getrecoverysettings, which prints the applied XML. There is also reagentc.exe /setrecoverysettings /path settings.xml for the command-line route and reagentc.exe /clearrecoverysettings to remove it.

Gotcha: quick machine recovery depends on the thing you are trying to fix. It runs inside WinRE. A device whose recovery partition is too small to be serviced is also a device whose cloud-recovery story is on shaky ground, and if the servicing fallback ever installs the recovery image onto the Windows partition, you have lost recovery on an encrypted volume. Fix the partition first, then turn on the clever feature that relies on it.

Proof it worked: real output from a live device

Everything below is a genuine run on a Windows 11 Enterprise 25H2 device, build 26200.9168, with the computer name and BCD identifier replaced. Nothing here is invented.

PowerShell - run elevated - Get-WinRePartitionReadiness.ps1
.\Get-WinRePartitionReadiness.ps1 Get-WinRePartitionReadiness - read-only WinRE servicing readiness report Run at (local): 2026-08-21 23:10:02 PowerShell : 5.1.26100.9168 (Desktop) Threshold : 250 MB free in the recovery partition == Operating system ================================================== DisplayVersion : 25H2 EditionID : Enterprise OS build (CurrentBuild.UBR) : 26200.9168 WinREVersion registry value : (value not present) == WinRE status (ReAgentc.exe /info) ================================= Windows RE status : Enabled Windows RE location : \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE Windows RE image version : 10.0.26100.9168 == Recovery partition geometry ======================================= Disk partition style : GPT Recovery partition number : 4 Recovery partition size (MB) : 2000 Recovery partition GPT type : {de94bba4-06d1-4d40-a16a-bfd50179d6ac} OS partition number : 3 Recovery is next after OS partition: True Unallocated gap between them (MB) : 0 Recovery volume label : WinRE_DRV Recovery volume free space (MB) : 1103 == ReAgent.xml state ================================================= ImageLocation path : (empty - no image staged) WinREStaged state : 0 == WinREAgent events in the System log =============================== Event 4501 (servicing succeeded) : 0 Event 4502 (servicing failed) : 0 == Verdict =========================================================== Documented threshold applied : 250 MB free Measured free space : 1103 MB VERDICT: READY # HEALTHY: 1103 MB free against a 250 MB requirement, partition 4 immediately after # partition 3, no staged image left over, zero 4502 events. Exit code 0. # BROKEN: the same report ending in VERDICT: NOT-READY and exit code 1. # NOTE: zero 4501 events here is expected. This device was built after the # servicing change and has a 2 GB recovery partition, so it has never # needed a standalone WinRE servicing pass in the lookback window.

The ReAgent.xml read is worth showing on its own, because it is the file Microsoft's own resize script edits. An empty ImageLocation with a zero GUID is the healthy idle state.

PowerShell - run elevated
Get-Content 'C:\Windows\System32\Recovery\ReAgent.xml' # Genuine read, GUIDs replaced with Microsoft placeholder style. <WindowsRE version="2.0"> <WinreBCD id="{aaaaaaaa-0b0b-1c1c-2d2d-333333333333}"/> <WinreLocation path="\Recovery\WindowsRE" id="0" offset="1022112038912" guid="{bbbbbbbb-0b0b-1c1c-2d2d-444444444444}"/> <ImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"/> <InstallState state="1"/> <WinREStaged state="0"/> <OsBuildVersion path="26100.1.amd64fre.ge_release.240331-1435"/> </WindowsRE> # HEALTHY: InstallState 1 (installed), WinREStaged 0, ImageLocation path empty. # BROKEN: a populated ImageLocation path on an idle device means a previous # servicing attempt left a staged image behind. Reboot before remediating. # WARNING: this file is state, not configuration. Do not hand-edit it.

Finally, the independent confirmation. Microsoft's documented method is to take the location from reagentc /info and ask DISM for the image version, then check that the ServicePack Build is greater than or equal to the UBR of the update you applied.

Command Prompt - elevated
Dism /Get-ImageInfo /ImageFile:\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE\winre.wim /index:1 # Illustrative output shape. Substitute the location your own reagentc /info printed. Version : 10.0.26100 ServicePack Build : 9168 ServicePack Level : 0 # HEALTHY: ServicePack Build at or above the OS UBR (9168 here). The recovery image # is as current as the OS. # BROKEN: a ServicePack Build well below the OS UBR. WinRE servicing is failing # silently, and free space is the first thing to measure.

Where does that leave you? The honest answer for most fleets is: check first, and you may not need to do anything. Devices imaged in the last couple of years tend to ship with 1 GB or larger recovery partitions and sail through. The affected population is usually older hardware, custom partition layouts, and images built before Microsoft moved WinRE servicing into the monthly cumulative update in June 2023. That is a set you can enumerate, ring-fence, and remediate carefully -- which is a completely different job from pushing partition surgery to everything you own.

References

No community deep-dive is cited here. Several well-known endpoint blogs were checked for on-topic coverage of the recovery-partition free-space failure and none verified as a genuine match, so the table is omitted rather than padded. An omitted citation is honest; an inherited one is not.

PowerShell — companion script

Download it from Imran76Awan/Windows-11-Scripts — no sign-in required. It is read-only: it reports and never changes a device or anything in Intune. Validate it in your own environment before relying on the output.

Get-WinRePartitionReadiness.ps1 — Read-only readiness report for the Windows Recovery Environment (WinRE) servicing
View all scripts on GitHub
Was this post helpful?
React below — no account needed
Share this post
LinkedIn X / Twitter Reddit Bluesky

More from EndpointWeekly

Windows 11
A Safeguard Hold Is Blocking Your Feature Update: Finding Which…
One device in the ring never gets the feature update, and Windows says nothing. That is a…
Windows 11
Reset this PC: cloud download versus local reinstall, and why…
Reset this PC has two image sources: rebuild from the files already on the device, or…
Windows 11
Windows Monthly Updates Explained: LCU, SSU, Patch Tuesday and…
Every month Windows ships updates and most admins do not know the difference between an…