How it works

Updated August 12, 2026 · min read

How to Find OneDrive Duplicate Files with Microsoft Graph

Design a read-only inventory that handles pagination, hashes, throttling, and safe output.

A proof-of-concept Graph call is easy; a reliable drive inventory is not. Production code must handle nested traversal or delta enumeration, pagination, deleted or changing items, packages, missing hashes, throttling, token refresh, and resume behavior.

Separate the provider adapter, scan job, duplicate engine, and review model. Persist checkpoints so retries do not create a misleading partial result, and mark scan completeness before presenting totals as authoritative.

A practical checklist

  1. 1Register OAuth and request the least-privilege read scope.
  2. 2Enumerate every page and record resumable progress.
  3. 3Normalize file IDs, sizes, paths, and supported hashes.
  4. 4Group by size and quickXorHash with explicit unresolved states.
  5. 5Expose a review/export layer independent of write operations.

Understand the situation

A proof-of-concept Graph call is easy; a reliable drive inventory is not. Production code must handle nested traversal or delta enumeration, pagination, deleted or changing items, packages, missing hashes, throttling, token refresh, and resume behavior.

Keep detection evidence separate from retention judgment. Technical signals can establish that bytes match, while path, permissions, history, and ownership determine whether one file item is operationally redundant.

Use a controlled workflow

Separate the provider adapter, scan job, duplicate engine, and review model. Persist checkpoints so retries do not create a misleading partial result, and mark scan completeness before presenting totals as authoritative.

A robust pipeline handles pagination, missing values, throttling, and changes during the scan. Incomplete data should lower confidence or remain unresolved instead of being converted into a clean-looking but unsafe result.

  • Enumerate every page and record resumable progress.
  • Normalize file IDs, sizes, paths, and supported hashes.
  • Group by size and quickXorHash with explicit unresolved states.

Make the final decision

Generate exact groups only from the defined evidence rule and preserve item IDs, paths, timestamps, and sharing context for review. Any future write operation should use separate incremental consent and revalidate the item immediately before action.

ClearCopies has a deliberately narrow promise: scan supported cloud metadata, confirm exact candidates by byte size plus a matching provider fingerprint, let the user review, and export the plan without downloading original content.

Limits and risks to check

  • Missing pagination silently creates incomplete inventories.
  • Throttling requires bounded retry and backoff.
  • Drive contents can change between scan and review.
  • Tokens, item metadata, and logs are sensitive.

Official references

Frequently asked questions

Should I download content and hash it myself?

Not for the metadata-only exact workflow when OneDrive provides a supported fingerprint. Content download changes privacy and bandwidth requirements.

Can I use filenames as a fallback?

Use them to show review candidates, not to label exact copies.

Should the same endpoint delete duplicates?

No. Keep inventory read-only and separate from any later, explicitly authorized and revalidated write workflow.

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.