Records Label Blocks Folder Cleanup: OneDrive for Business Fix
🔍 WiseChecker

Records Label Blocks Folder Cleanup: OneDrive for Business Fix

You are trying to delete or move a folder in OneDrive for Business, but you get an error saying the action is blocked. This typically happens because a Microsoft 365 compliance records label has been applied to a file inside that folder. The label locks the file so it cannot be modified, which also prevents the parent folder from being cleaned up. This article explains why records labels block folder operations and gives you the exact steps to remove the label and complete the cleanup.

Key Takeaways: How to Unblock a OneDrive Folder Locked by a Records Label

  • Microsoft Purview compliance portal > Records management > File plan: Locate and delete or modify the records label that is applied to the file inside the blocked folder.
  • OneDrive web > Info panel > Details > Retention label: Check which label is applied to the specific file that is preventing the folder operation.
  • PowerShell cmdlet Remove-ComplianceRetentionLabel: Use Exchange Online PowerShell to bulk-remove a records label from multiple files if the web interface is too slow.

ADVERTISEMENT

Why a Records Label Blocks Folder Cleanup in OneDrive

A records label in Microsoft 365 Compliance is a retention label that marks a file as a record. When a record label is applied, the file becomes read-only and cannot be deleted, edited, or moved by anyone, including the file owner and global administrators. The label is enforced at the item level, meaning the restriction applies to the individual file, not the folder. However, because OneDrive treats the folder as a container, you cannot delete, rename, or move a folder that contains a locked file. This is a deliberate design by Microsoft to prevent accidental destruction of regulated content.

The issue often occurs after an organization deploys a default records label policy that automatically applies a label to all documents in a specific OneDrive library. Users who then try to organize their folders encounter the block. The error message typically says: “The action cannot be completed because this item is marked as a record.” The fix requires identifying the exact file with the label, then removing or modifying the label through the compliance portal.

Steps to Identify and Remove the Records Label Blocking Your Folder

Follow these steps in order. Do not skip the identification step, as removing the wrong label can cause compliance gaps.

Step 1: Identify the File with the Records Label

  1. Open OneDrive in a web browser
    Go to https://onedrive.live.com and sign in with your work or school account.
  2. Navigate to the blocked folder
    Browse to the folder you cannot delete or move. Do not try to delete it yet.
  3. Open the folder and locate the file with the lock icon
    Look for a file that shows a small lock icon overlay. This icon indicates a records label is applied.
  4. Select the file and open the Info panel
    Click the file once. On the right side of the screen, click the Info icon (a circle with an i). Scroll down to the Details section.
  5. Check the Retention label field
    Under Details, find Retention label. It shows the name of the records label applied. Write down this label name.

Step 2: Remove or Modify the Records Label in the Compliance Portal

  1. Open the Microsoft Purview compliance portal
    Go to https://compliance.microsoft.com and sign in as a Compliance Administrator or Global Administrator.
  2. Go to Records management > File plan
    In the left navigation, expand Records management and select File plan.
  3. Find the label by name
    Use the search box to find the label you identified in Step 1. Click the label name to open its properties.
  4. Change the label to a non-record label or delete it
    You have two options:

    Option A: Change the label type. In the label properties, under Retention action, change the setting from Mark as a record to Retain content or No retention. This removes the lock from all files with this label.

    Option B: Delete the label. Scroll to the bottom of the label properties and click Delete label. Confirm the deletion. This removes the label from all files and unlocks them.

  5. Wait for the change to propagate
    Label changes can take up to 24 hours to apply to all files. In most cases, the change takes effect within one hour. After propagation, the lock icon disappears from the file in OneDrive.

Step 3: Clean Up the Folder

  1. Return to OneDrive in your browser
    Refresh the page. The folder should no longer show a lock icon.
  2. Delete or move the folder
    Right-click the folder and select Delete to send it to the recycle bin, or select Move to to relocate it.
  3. Check the recycle bin if deletion fails
    If the folder still cannot be deleted, empty the OneDrive recycle bin first. Sometimes a file inside the folder was already deleted but the label persists in the recycle bin.

ADVERTISEMENT

If OneDrive Still Blocks the Folder After Removing the Label

The label was removed but the file still shows a lock icon

This can happen if the label change has not fully propagated. Wait 24 hours and check again. If the lock persists, use the Check compliance status option in the file Info panel to force a refresh. If the issue remains, the file may have a second label applied from a different policy. Repeat Step 1 to identify the second label.

The folder contains multiple files with different labels

If multiple files in the folder have records labels, you must remove or modify each label individually. Use the Info panel on each file to identify the label name. For bulk operations, use PowerShell with the Remove-ComplianceRetentionLabel cmdlet. This cmdlet can remove a label from multiple files in one command if you provide a CSV list of file paths.

You are not a compliance administrator and cannot access the Purview portal

Submit a request to your IT department. Provide them with the file path and the label name you identified. They can remove the label from the compliance portal. In the meantime, do not attempt to delete the folder by force, as that can corrupt the file metadata.

Records Label vs Retention Label: Key Differences for Folder Cleanup

Item Records Label Standard Retention Label
Description Marks a file as a record, making it read-only and undeletable Retains the file for a set period but allows editing and deletion
Effect on folder operations Blocks deletion, move, rename of the parent folder Does not block folder operations
Lock icon in OneDrive Shows a lock overlay on the file No lock icon
Permission to remove Requires Compliance Admin or Global Admin Can be removed by the file owner if the policy allows

You can now identify which files in your OneDrive folder have a records label and remove that label through the Microsoft Purview compliance portal. After the label is removed, the folder can be deleted or moved normally. For future prevention, ask your compliance team to apply labels at the folder level instead of the file level, or to use standard retention labels that do not lock files. As an advanced tip, use the OneDrive sync client version 22.222 or later, which shows a specific error code 0x8004DEC0 when a records label blocks a folder, making troubleshooting faster.

ADVERTISEMENT