Teams & migration

Updated August 12, 2026 · min read

How to Automate OneDrive Duplicate Detection Without Automatic Deletion

Schedule read-only inventories and review exports while keeping modification behind explicit human approval.

Detection is a strong automation candidate because its evidence can be reproduced and reviewed. Deletion carries changing business context, permissions, retention, and stale-state risk that should not be hidden inside a scheduled scan.

Run an incremental or periodic inventory with checkpoints, retry handling, completeness status, and change reporting. Notify owners about new high-value exact groups and let them review a saved plan without granting the scanner write permission.

A practical checklist

  1. 1Use a least-privilege read-only service workflow.
  2. 2Handle pagination, throttling, retries, and incomplete scans.
  3. 3Group only size-and-quickXorHash exact candidates.
  4. 4Send owners a reviewable report with no automatic action.
  5. 5Track sources of recurrence and resolve them upstream.

Understand the situation

Detection is a strong automation candidate because its evidence can be reproduced and reviewed. Deletion carries changing business context, permissions, retention, and stale-state risk that should not be hidden inside a scheduled scan.

Team libraries need an owner and a decision trail. A byte-identical file may still be required in a separately permissioned workspace, under a retention rule, or as the target of a shared link.

Use a controlled workflow

Run an incremental or periodic inventory with checkpoints, retry handling, completeness status, and change reporting. Notify owners about new high-value exact groups and let them review a saved plan without granting the scanner write permission.

Pilot the workflow on a representative scope, record exceptions, and measure false positives before expanding. Business cleanup is safer as a governed series of batches than as a single drive-wide action.

  • Handle pagination, throttling, retries, and incomplete scans.
  • Group only size-and-quickXorHash exact candidates.
  • Send owners a reviewable report with no automatic action.

Make the final decision

Measure detection quality and recurrence, then fix the workflows that generate repeats. If a separate cleanup feature is later used, require current plan approval, incremental write consent, server-side authorization, and per-item revalidation.

The exported plan should be useful outside the scanner: identify the account and scan, retained items, candidates, evidence, reviewer, and exceptions so another person can audit the decision.

Limits and risks to check

  • Scheduled jobs can silently publish partial results.
  • Long-lived tokens and metadata need strong controls.
  • A stale detection result is unsafe for later action.
  • Notification volume can cause owners to ignore important groups.

Official references

Frequently asked questions

What is safe to automate?

Inventory, exact grouping, metrics, and review notifications can be automated when failures are visible.

Why not delete exact copies automatically?

Exact content does not resolve sharing, history, retention, or canonical-location decisions, and drive state can change.

What should trigger a rescan?

Use a documented schedule or meaningful inventory changes, and clearly label the scan time and completeness.

Scan first. Decide with evidence.

ClearCopies reads supported cloud-drive metadata and groups exact copies by byte size plus a provider-supplied content fingerprint. Original file bodies are not downloaded for the scan. You review the result and export a plan before any separate write step.