POWERSHELL / MIGRATION
ProAdvancedRead-onlyLow

Compare pre- and post-migration Microsoft 365 inventory exports

Compares normalized pre- and post-migration CSV inventories locally and reports matched, missing, added and changed records without connecting to either tenant or a migration vendor.

Pro generation after license validation · Review before running · No tenant access by Opselith

What this PowerShell script does

Compares normalized pre- and post-migration CSV inventories locally and reports matched, missing, added and changed records without connecting to either tenant or a migration vendor.

Requirements

  • Pre-migration CSV path - Source/pre-migration inventory CSV. (Required)
  • Post-migration CSV path - Destination/post-migration inventory CSV. (Required)
  • Dataset type - Selects sensible auto-key and comparison behavior. (Required)
  • Match key - Use auto unless your two exports intentionally share a different stable key. (Required)
  • Optional key mapping CSV - Optional CSV with SourceKey and DestinationKey for renamed identities or URLs. (Optional)
  • Comparison CSV path - Use a new absolute Windows CSV path. (Required)

Environment

  • Module: Local PowerShell
  • Runtime: 5.1 / 7
  • Permissions: None. Comparison uses existing local CSV exports only.
  • Risk: Low
Review before you runUse exports that represent the same workload and review the chosen match key. Supply SourceKey/DestinationKey mappings when identifiers intentionally changed.
OPS / WORKSPACE

Ready to generate

Configure Compare pre- and post-migration Microsoft 365 inventory exports in the Builder, review the generated PowerShell and run it in your own environment.

When to use this template

Use this after a migration wave to compare normalized source and destination exports with a stable key or an explicit source-to-destination key map.

Important limitations

Generate the script

  1. Open this template in the PowerShell Builder.
  2. Enter the required values and review the documented permissions and output.
  3. Generate the script, inspect it, then run it in your own PowerShell environment.
Generate Compare pre- and post-migration Microsoft 365 inventory exports →
OPS / SCRIPT DETAILS

Script details

Compares normalized pre- and post-migration CSV inventories locally and reports matched, missing, added and changed records without connecting to either tenant or a migration vendor. Review these details before generating or running the script.

microsoft-365migrationvalidationcomparisonpost-migrationcsv

What it works with

Module: Local PowerShell

Context: Windows PowerShell 5.1 or PowerShell 7 · local CSV comparison

Compatibility: Pure local PowerShell; Windows PowerShell 5.1 and PowerShell 7 are supported.

Permissions and impact

Permissions: None. Comparison uses existing local CSV exports only.

Risk: Low

Execution impact: Read-only. Reads administrative data and does not intentionally change the target environment.

Parameters

  • Pre-migration CSV path - Source/pre-migration inventory CSV. (Required)
  • Post-migration CSV path - Destination/post-migration inventory CSV. (Required)
  • Dataset type - Selects sensible auto-key and comparison behavior. (Required)
  • Match key - Use auto unless your two exports intentionally share a different stable key. (Required)
  • Optional key mapping CSV - Optional CSV with SourceKey and DestinationKey for renamed identities or URLs. (Optional)
  • Comparison CSV path - Use a new absolute Windows CSV path. (Required)

Output

Output: CSV with DatasetType, SourceKey, DestinationKey, Status, Column, SourceValue, DestinationValue and Warning.

This template is part of the Pro library. The full Pro script is generated by Opselith after server-side license validation; only the configuration values needed by this template are sent for generation. No tenant connection is required. When you generate a Pro script, only the configuration values needed for that template are sent to Opselith after license validation.

Example use

Compares normalized pre- and post-migration CSV inventories locally and reports matched, missing, added and changed records without connecting to either tenant or a migration vendor.

Enter the required values in the Builder, review the generated script and confirm the output before running it.

Before you run: Use exports that represent the same workload and review the chosen match key. Supply SourceKey/DestinationKey mappings when identifiers intentionally changed.

Opselith quality checks

  • Included in the current Opselith PowerShell quality suite
  • Local-only comparison
  • Duplicate keys rejected
  • Optional source-to-destination key mapping
  • No giant nested JSON in CSV
  • Formula-injection protection