About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Event 1123 in the Windows Defender operational log means controlled folder access (CFA) blocked a program from changing or deleting a file in a protected folder. If that program is your backup or restore agent, the job fails or skips files, even though nothing is wrong with the backup product. The fix is to find the exact program and folder in the event, then allow that one program by its full path, rather than switching ransomware protection off.
CFA is a ransomware control. A backup agent that restores files looks, to CFA, like an unknown program rewriting your documents, so it is stopped until you say otherwise.
What the error means
Microsoft describes CFA as a defence against ransomware that works "by allowing only trusted apps to change files in protected folders". Three parts matter for backups:
- Protected folders. By default these are the user folders (Documents, Favorites, Music, Pictures, Videos) of every account, the public equivalents, and the boot sector of the hard drive. You cannot remove a default folder. You can add your own, and subfolders of an added folder are protected too. Network shares and mapped drives can be added.
- Trusted apps. Defender trusts most programs automatically, based on prevalence and reputation. A backup agent from a small vendor, or one that has just updated, may not qualify.
- Disk sectors. Untrusted programs cannot write directly to the sectors holding the boot record.
Microsoft states that CFA is off by default. So if you see event 1123 on a server, someone or some policy turned it on: Intune, Group Policy, Configuration Manager, PowerShell or the Windows Security app are all listed as ways to do it.
What the documentation says is blocked is modification and deletion of files in protected folders, and writes to boot sectors. It does not describe reads being blocked. For backup software that points to the write side of the job: restores, a backup target or staging folder inside a protected path, clean-up of old backups, and imaging tools that write sectors.
CFA only works while Microsoft Defender Antivirus is the primary antivirus, in active mode, with real-time protection on. Microsoft lists passive mode, limited periodic scanning and "Off" as modes where CFA does not work. If another product is the primary antivirus, you will not see these events.
The events to look for
Microsoft lists these in Event Viewer under Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational:
| Event ID | Meaning (Microsoft's wording) |
|---|---|
| 1123 | Blocked CFA event |
| 1124 | Audited CFA event |
| 1127 | Blocked CFA sector write block event |
| 1128 | Audited CFA sector write block event |
| 5007 | Event when settings are changed |
Microsoft adds that "CFA blocks don't generate alerts in the Alerts queue" in Defender for Endpoint, so nobody is paged when a backup agent is blocked. You find out when a job fails.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Restore into a protected folder by an agent CFA does not trust | Restore fails or skips files in Documents, Pictures or a user profile; event 1123 per blocked change | Event 1123 shows the agent's program path and a file under a protected folder |
| Backup repository, staging folder or catalogue folder was added to the protected list | Backups or clean-up fail on one path only; local or share path is in the protected list | Get-MpPreference protected folder list contains the path |
| Allowed app entered with the wrong path, or the program moved after an update | Agent was allowed once, then blocked again after an upgrade | Allowed list path differs from the program path in the event |
| Allowed app added while the service was running | Still blocked right after the change | Service has not restarted since the change; Microsoft says the allowance takes effect when the app or service starts |
| Backup runs as a script (PowerShell, batch via an interpreter) | Block names the script engine, not the backup tool | Event names powershell.exe or similar |
| Imaging or bare-metal restore tool writing disk sectors | Event 1127 rather than 1123 | Event ID |
| Management software injecting code into every process | CFA stops trusting programs that were trusted before | Microsoft's client analyzer with -cfa names the reason |
Prove the cause before changing anything
These checks only read. They change no setting.
- Find the events. In Event Viewer, go to Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational and filter for 1123. Or use PowerShell. The Get-WinEvent documentation shows a hash table with an
Idvalue:
Get-WinEvent -FilterHashtable @{ LogName='Microsoft-Windows-Windows Defender/Operational'; Id=1123 }
The channel name Microsoft-Windows-Windows Defender/Operational is the form Microsoft gives as an example of an event channel. Microsoft's monitoring page lists the IDs but does not list the fields of each message, so read the message on your own system and note two things: the program that was blocked, and the file or folder it tried to change.
- Check the mode. From an elevated PowerShell session:
Get-MpPreference | Format-Table EnableControlledFolderAccess
The values are 0 or Disabled (default), 1 or Enabled, 2 or AuditMode, 3 or BlockDiskModificationOnly, 4 or AuditDiskModificationOnly. Mode 3 blocks sector writes only and cannot cause a 1123.
- List the current protected folders and allowed apps. Microsoft gives this command:
$cfa = Get-MpPreference; "ProtectedFolders:"; "-"*25; $cfa.ControlledFolderAccessProtectedFolders | Sort-Object; "`n`n"; "AllowedApplications:"; "-"*25; $cfa.ControlledFolderAccessAllowedApplications | Sort-Object
Compare the blocked program's path with the allowed list, character for character. Microsoft says only the app in the stated location is allowed; an app with the same name elsewhere is not.
-
If you have Defender for Endpoint Plan 2, advanced hunting can list blocks. Microsoft's sample query filters
DeviceEventson the action typesControlledFolderAccessViolationAuditedandControlledFolderAccessViolationBlocked, and aprojectline can showFileName,FolderPath,InitiatingProcessFileNameandInitiatingProcessCommandLine. -
If an app is allowed but still blocked, run the Defender for Endpoint client analyzer with the
-cfaargument. Microsoft says it reports the reason for each detection, and that software which injects code into every process can make CFA stop trusting known applications.
Example (illustrative): on fs01, a nightly restore test by C:\Program Files\BackupAgent\agent.exe into C:\Users\Public\Documents\restore-test fails. Event Viewer shows several 1123 events in the Windows Defender operational log, all naming agent.exe and files under C:\Users\Public\Documents, which is a default protected folder. The mode is 1 (Enabled), the allowed list is empty. The cause is the first row of the table: an untrusted program restoring into a protected folder. The same agent's nightly backup raises no event; the documentation describes blocked changes and deletions, and a backup mostly reads.
Fix
Cause: untrusted agent restoring or cleaning up in a protected folder
Allow the one program. Microsoft's syntax, in an elevated PowerShell session, is:
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\BackupAgent\agent.exe"
Risk: this lets that program modify and delete files in every protected folder, so allow only the executable that does the work and only after you have confirmed it is the genuine file from your backup vendor. To undo it, run the same command with Remove-MpPreference; Microsoft states the syntax is identical for Add-MpPreference, Set-MpPreference and Remove-MpPreference.
Risk: do not use Set-MpPreference for this unless you mean to. Microsoft warns that it "overwrites any existing protected folders or allowed apps with the values you specify". Add-MpPreference keeps what is there.
Microsoft says an allowed app takes effect only when the app or service starts, so restart the backup agent's service (or the program) after the change.
Disruptive step: restarting the service stops any backup or restore job that is running, and that job fails or must be started again. Restart outside the backup window. There is no way to resume the interrupted run; start it again once the service is back.
The Windows Security app can do this too: Virus & threat protection > Manage settings > Manage controlled folder access > Allow an app through Controlled folder access. If the setting is delivered by Intune, Group Policy or another management tool, make the change there so the policy and the setting agree.
Cause: allowed path wrong, or the program moves on update
Allowed apps accept environment variables and wildcards (*) in the folder part of the path, not in the file name. Microsoft's own example is %ProgramFiles%\Fabrikam\DriveManager\*\DriveService.exe, which allows the executable under any version subfolder. Use a wildcard only where the vendor's install folder genuinely changes between versions.
Cause: backup folder added to the protected list
Protecting a backup repository with CFA is a reasonable use: untrusted programs then cannot alter the backup files. If you protect it, allow the backup agent by path as above. Removing the folder from the protected list also stops the blocks, but it removes that protection:
Risk: removing a folder from the protected list means untrusted programs can change or delete its contents again. Put it back with Add-MpPreference -ControlledFolderAccessProtectedFolders "<path>" if you change your mind.
Cause: job runs as a script
Microsoft says script engines such as PowerShell "aren't trusted by CFA, even if you create an 'allow' indicator", and that the only way to allow a script engine to modify protected folders is to add it as an allowed app. That allows every script that engine runs, so prefer a compiled backup tool with its own signed executable.
Cause: imaging tool blocked on sector writes (1127)
Microsoft says to use audit mode for disk modification only (mode 4) first, to confirm that no legitimate software ("disk-imaging, backup, encryption, or partitioning tools") writes to sectors before you switch to blocking. If your recovery tool must write sectors, that is a decision about the mode, not an app allowance; the configure page lists the modes and which management methods support them.
Testing on a non-production machine
Microsoft recommends running CFA in audit mode first, where untrusted programs are not blocked but the attempts are recorded (event 1124 instead of 1123). Set-MpPreference -EnableControlledFolderAccess AuditMode sets it.
Risk: audit mode stops blocking. Use it on a test machine or before a first rollout, not as a way to make a failing job on a production server pass. To go back, set the mode to Enabled.
Confirm the fix
- Re-run the failed restore or clean-up job after restarting the agent's service.
- In the Windows Defender operational log, check that no new 1123 events name the agent after the time of your change.
- Run the earlier
$cfacommand again to confirm the allowed path is present and correct. - Confirm the restored files are present and readable. A job that ends without an error and a restore that produced the right files are separate results.
What to watch afterwards
- Agent upgrades. If the program path changes, the allowance no longer matches and the next restore is blocked again.
- A new 1123 event for any program you do not recognise. That may be CFA doing its job.
- Event 5007, which Microsoft lists as the event when settings are changed, shows that the protection settings were changed.
- Because blocks raise no alert, add the log to your monitoring or forward it. Microsoft notes that Windows Event Forwarding can centralise CFA events.
- Shared folders. Microsoft warns that enabling CFA can reduce network performance when an untrusted process accesses shared network folders.
Read next
Related articles you may want next.
- Backup & RecoveryVSS Writer Failed? Diagnose It Before the Next BackupWindows VM backup failed at the VSS stage? Read each writer's state, phase and last error, find the owning service, and decide the fix before the next run.Read article
- Backup & RecoveryPrevious Versions and shadow copies are not a backup: what they are good for, and where they stopUnderstand local Windows shadow-copy dependencies, automatic deletion, administrative access and why independent retained backups still matter.Read article
- Backup & RecoveryRecovering After Ransomware: Clean-Room Build, Restore Order and Assessing Backup TrustRecover without reinfection: preserve evidence, build an isolated recovery environment, choose and test a restore point, and restore in a safe order.Read article
Risks and limits
- These commands have not been run or lab-tested. They are taken from Microsoft Learn pages dated 25 June to 31 August 2026.
- Microsoft's monitoring page lists the event IDs and their meanings but not the fields inside each event, so no sample event output is shown here.
- CFA behaviour depends on Microsoft Defender Antivirus being the active antivirus. Third-party antivirus products have their own controls, not covered here.
- Allowing an app trusts that executable. A wrong or tampered file allowed by path gets the same access as the real one.
- Microsoft lists Windows Server 2019 or later for CFA, and Windows Server 2016 and 2012 R2 only as part of the modern, unified Defender for Endpoint solution. Check your own build before relying on a setting.
- A backup agent that is blocked while restoring may have restored part of the data. Treat a failed restore as incomplete until you have compared what arrived with the source.
Sources
- Controlled folder access (CFA) overview — Microsoft Learn, last updated 17 July 2026, accessed 17 November 2026
- Configure controlled folder access (CFA) — Microsoft Learn, updated 31 August 2026 (page metadata), accessed 17 November 2026
- Monitor controlled folder access (CFA) activity — Microsoft Learn, last updated 25 June 2026, accessed 17 November 2026
- Get-WinEvent — Microsoft Learn, 12 August 2026 (page metadata), accessed 17 November 2026
- Review event logs and error codes to troubleshoot issues with Microsoft Defender Antivirus — Microsoft Learn, last updated 1 June 2026, source of the event channel name
Microsoft-Windows-Windows Defender/Operational, accessed 17 November 2026
This article was originally published on .