Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Exchange Online Shared Mailbox Resolver & Migration Planner Pre-Processor

This script pre-processes Microsoft 365 / Exchange Online mailbox export CSVs to ensure 100% resolution when scanning Shared Mailboxes in the Google Workspace Migration Planner.

Prerequisites & Requirements

Before running this script in a environment, ensure you have:

1. System Requirements & Module

  • PowerShell 7+ (Recommended) or PowerShell 5.1 on Windows/macOS/Linux.
  • ExchangeOnlineManagement Module (v3.0.0 or later):
    Install-Module -Name ExchangeOnlineManagement -AllowClobber -Force

2. Required M365 Permissions

The admin account running the script must have at least one of the following roles in Exchange Online:

  • Global Reader
  • Exchange Administrator
  • View-Only Recipients

Step-by-Step Guide

Step 1: Prepare the CSV

Obtain the list of shared mailboxes.

  • The CSV can contain any standard header name for emails (Email Id, Email, PrimarySmtpAddress, UserPrincipalName, Identity, or EmailAddress).
  • Example input.csv:
    Email Id
    sales@company.com
    support-alias@company.com
    info-shared@tenant.onmicrosoft.com

Step 2: Execute the Script

  1. Open PowerShell and navigate to or run UPN_SHaredMailboxes.ps1:

    .\UPN_SHaredMailboxes.ps1
  2. Authenticate with Exchange Online:

    • If not already connected, an interactive M365 sign-in prompt will open. Log in using an account with appropriate Exchange Online read permissions.
  3. Provide Input File Path:

    • When prompted:
      Enter the path to your input CSV file (e.g., C:\Migration\input.csv):
      
    • Drag and drop the CSV file into the terminal window or type the full file path.

Step 3: Script Execution & In-Memory Processing

The script will perform the following steps automatically:

  1. Pre-fetch: Downloads tenant mailbox data in a single batch.
  2. Hashtable Mapping: Maps every primary email, UPN, and alias to its respective Exchange Online mailbox object.
  3. Instant Lookup: Resolves all input rows in seconds without incurring Graph API throttling.

Sample Output:

Connecting to Exchange Online...
Successfully loaded 1808 entries from CSV.
Using column 'Email Id' for Exchange Online lookup...
Processing... Please wait.

Pre-fetching Exchange Online mailboxes into memory...
Loaded 4250 email address/alias mappings from Exchange Online.

============================================================
                    PROCESSING COMPLETE                     
============================================================
 Total Input Rows           : 1808
 Successfully Resolved      : 1808
 Shared Mailboxes Found     : 1750
 User Mailboxes / Other     : 58
 Not Found / Skipped        : 0
============================================================

OUTPUT FILES GENERATED:
 1. Migration Planner CSV   : C:\Migration\MigrationPlanner_SharedMailboxes_UPN.csv
 2. Full Audit Report       : C:\Migration\ExchangeOnline_Full_Audit_Report.csv

Step 4: Upload Clean CSV to Google Workspace Migration Planner

  1. Open the Google Workspace Migration Planner tool.
  2. Navigate to the Shared Mailboxes scan/discovery section.
  3. Upload MigrationPlanner_SharedMailboxes_UPN.csv generated by the script.
  4. Result: The Migration Planner will resolve 100% of valid shared mailboxes without dropping entries or failing on alias mismatches.

Output Files Reference

File Name Description Purpose
MigrationPlanner_SharedMailboxes_UPN.csv Clean CSV containing single column Email Id populated only with exact Entra ID UPNs of verified SharedMailbox accounts. Feed directly into Google Workspace Migration Planner.
ExchangeOnline_Full_Audit_Report.csv Comprehensive diagnostic report containing Input Email, UserPrincipalName, PrimarySmtpAddress, RecipientType, and Status. Use for review, identifying non-shared mailboxes (e.g. UserMailbox), or investigating missing accounts.

🛠️ Troubleshooting & Notes

  • Module not found: If Connect-ExchangeOnline fails, run Install-Module ExchangeOnlineManagement -Force.
  • Not Found / Skipped Entries: Check ExchangeOnline_Full_Audit_Report.csv for any rows marked NOT_FOUND to verify if accounts were deleted or misspelled in the CSV.
  • UserMailbox in Shared Scan: If regular user accounts are included, they will be listed as UserMailbox in the audit report and automatically excluded from the Migration Planner output CSV.

About

This script pre-processes Microsoft 365 / Exchange Online mailbox export CSVs to ensure 100% resolution when scanning Shared Mailboxes in the Google Workspace Migration Planner.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages