IAMinerva
HomeBlogAbout
m3M365 NewscoMicrosoft CopilotteMicrosoft TeamsshSharePoint & OneDriveinIntune & SecurityexExchange & OutlookpoPower PlatformazAzure & Entra IDtuTutorials & GuidesevEvents & ConferencesseSecuritywiWindows
IAMinerva

Professional blog dedicated to the Microsoft 365 ecosystem.

Quick links

HomeBlogAboutNewsletter

Stay informed

Get the latest Microsoft 365 news delivered straight to your inbox.

© 2026 IAMinerva. All rights reserved.

Built withNext.js&Tailwind
Microsoft365DSC : Comparer les configurations M365 entre tenants
BlogM365 NewsMicrosoft365DSC: Compare M365 Configurations Between Tenants
M365 News#Microsoft365DSC#PowerShell#Configuration Management

Microsoft365DSC: Compare M365 Configurations Between Tenants

Discover Microsoft365DSC to automatically compare M365 configurations between tenants and generate detailed divergence reports.

Houssem MAKHLOUF
March 10, 2026
6 min read

TL;DR par Minerva

généré par IA

Discover Microsoft365DSC to automatically compare M365 configurations between tenants and generate detailed divergence reports.

Introduction to Comparing Microsoft 365 Configurations

Managing multiple Microsoft 365 tenants presents consistency and security challenges. Microsoft365DSC stands out as the reference tool for automating configuration comparison across environments. This free PowerShell DSC-based solution transforms the tedious manual task of verifying settings into an automated and reliable process.

i

Why Compare M365 Configurations?

Configuration discrepancies between tenants can create security vulnerabilities. A properly configured tenant can resist cyberattacks while another, misconfigured, becomes an easy target.

Introduction to Microsoft365DSC

Microsoft365DSC is an open-source framework that leverages PowerShell Desired State Configuration to manage Microsoft 365 configurations using the "Configuration as Code" approach. This modern approach enables you to:

  • Automate tenant parameter configuration
  • Export existing configurations to files
  • Synchronize configurations across different tenants
  • Monitor parameter changes in real-time

Benefits of Microsoft365DSC for Configuration Comparison

Using Microsoft365DSC to compare configurations offers several operational benefits:

Efficient Change Tracking

  • Rapid identification of configuration changes
  • Preservation of critical security policies
  • Automatic alerts on configuration drift

Simplified Migration Between Tenants

  • Perfect configuration alignment during cross-tenant migrations
  • Automated post-migration consistency verification
  • Reduced risk of human error

Establishing Best Practices

  • Comparative analysis of security configurations
  • Identification of optimal configurations
  • Unified deployment of best practices
✦

Prerequisites

Before getting started, ensure you install the Microsoft365DSC module via PowerShell: Install-Module Microsoft365DSC

Configuration Comparison with New-M365DSCDeltaReport

The New-M365DSCDeltaReport cmdlet is at the heart of the comparison functionality. It allows two distinct usage scenarios:

Comparing Two Microsoft 365 Tenants

To compare configurations of two different tenants, follow this procedure:

1

Export Configurations

Use the Export-M365DSCConfiguration cmdlet to extract configurations from each tenant:

⚡PowerShell
1# Export Tenant A
2Export-M365DSCConfiguration -Credential $TenantACredential -Path "D:\M365DSC\TenantAconfig.ps1"
3
4# Export Tenant B
5Export-M365DSCConfiguration -Credential $TenantBCredential -Path "D:\M365DSC\TenantBconfig.ps1"
2

Generate Divergence Report

Execute the comparison with the following cmdlet:

⚡PowerShell
1New-M365DSCDeltaReport -Source "D:\M365DSC\TenantAconfig.ps1" -Destination "D:\M365DSC\TenantBconfig.ps1" -OutputPath "D:\M365DSC\DiscrepancyReport.html"
3

Analyze the HTML Report

The generated report displays:

  • Missing configurations
  • Parameter differences between tenants
  • Remediation recommendations

Use M365DSC to compare Microsoft 365 settings of two tenants

Advanced Report Generation Options

Divergence Report Only

To view only different configurations, use the -DriftsOnly parameter:

⚡PowerShell
1New-M365DSCDeltaReport -Source "D:\M365DSC\TenantAconfig.ps1" -Destination "D:\M365DSC\TenantBconfig.ps1" -OutputPath "D:\M365DSC\Report.html" -DriftsOnly $true

Conditional Access Delta Report with Drifts Only

JSON Output Format

To get a structured report in JSON format:

⚡PowerShell
1New-M365DSCDeltaReport -Source "D:\M365DSC\TenantAconfig.ps1" -Destination "D:\M365DSC\TenantBconfig.ps1" -OutputPath "D:\M365DSC\Report.json" -Type JSON

Use M365DSC to Compare Microsoft 365 Settings

Temporal Configuration Comparison

Microsoft365DSC also allows comparing configuration changes for the same tenant over time. This functionality proves particularly useful for:

  • Auditing configuration changes
  • Identifying security drift
  • Tracking parameter evolution
⚡PowerShell
1New-M365DSCDeltaReport -Source "D:\M365DSC\TenantConfigRecent.ps1" -Destination "D:\M365DSC\TenantConfigOld.ps1" -OutputPath "D:\DiscrepancyReport.html"
!

Configuration Archiving

To perform effective temporal comparisons, maintain a history of exported configurations at regular intervals (monthly or quarterly).

Validation with Blueprints: Assert-M365DSCBlueprint

The blueprint functionality represents a major advancement in configuration validation. It allows comparing a tenant against approved reference configurations.

Creating a Microsoft 365 Blueprint

A Microsoft365DSC blueprint is a PowerShell DSC file containing:

  • Reference configurations
  • Severity level metadata
  • Explanatory comments

Example blueprint structure:

⚡PowerShell
1Node localhost {
2 AADConditionalAccessPolicy "AADConditionalAccessPolicy-Block Access to M365" {
3 BuiltInControls = @("mfa"); ### L1|We recommend requiring MFA for all users
4 DisplayName = "Block Access to M365";
5 ExcludeUsers = @("AdminGlobal"); ### L2|We recommend excluding the global admin to prevent lockout
6 State = "enabled"; ### L3|We recommend enabling the policy to enforce it
7 }
8}

Metadata Severity Levels

Blueprints use three severity levels:

LevelColorDescription
L1RedCritical - High security risk
L2YellowWarning - Recommended configuration
L3WhiteInformation - Best practice

Executing Blueprint Validation

Use the Assert-M365DSCBlueprint cmdlet to validate your tenant:

⚡PowerShell
1Assert-M365DSCBlueprint -BluePrintUrl "D:\M365DSC\SecurityBlueprint.ps1" -OutputReportPath "D:\M365DSC\ValidationReport.html" -Credentials (Get-Credential)

Use M365DSC to compare Microsoft 365 settings with blueprints

use Microsoft365DSC to get compare Microsoft 365 settings and get Delta Report

Practical PowerShell Scripts

Automated Comparison Script

⚡PowerShell
1# Multi-tenant automated comparison script
2$TenantA = "tenant-a.onmicrosoft.com"
3$TenantB = "tenant-b.onmicrosoft.com"
4$OutputPath = "D:\M365DSC\Reports"
5
6# Authentication
7$CredA = Get-Credential -Message "Credentials for $TenantA"
8$CredB = Get-Credential -Message "Credentials for $TenantB"
9
10# Export configurations
11Export-M365DSCConfiguration -Credential $CredA -Path "$OutputPath\$TenantA-config.ps1"
12Export-M365DSCConfiguration -Credential $CredB -Path "$OutputPath\$TenantB-config.ps1"
13
14# Generate report
15$ReportPath = "$OutputPath\Comparison-$(Get-Date -Format 'yyyyMMdd').html"
16New-M365DSCDeltaReport -Source "$OutputPath\$TenantA-config.ps1" -Destination "$OutputPath\$TenantB-config.ps1" -OutputPath $ReportPath
17
18Write-Host "Report generated: $ReportPath" -ForegroundColor Green

Blueprint Validation Script

⚡PowerShell
1# Automated validation with blueprint
2$BlueprintPath = "D:\M365DSC\Blueprints\SecurityBaseline.ps1"
3$ReportPath = "D:\M365DSC\Reports\Validation-$(Get-Date -Format 'yyyyMMdd').html"
4$Credentials = Get-Credential
5
6try {
7 Assert-M365DSCBlueprint -BluePrintUrl $BlueprintPath -OutputReportPath $ReportPath -Credentials $Credentials
8 Write-Host "Validation successful. Report: $ReportPath" -ForegroundColor Green
9}
10catch {
11 Write-Error "Error during validation: $($_.Exception.Message)"
12}

Specialized Use Cases by Microsoft 365 Service

Entra ID - Critical Configurations

  • Conditional Access Policies: Monitoring MFA rules
  • Cross-tenant Settings: Validating external access
  • Authentication Methods: Controlling login options

Exchange Online - Essential Parameters

  • Mailbox Permissions: Auditing access rights
  • Auto-reply Policies: Standardizing parameters
  • OWA Configuration: Standardizing web interface

Microsoft Teams - Crucial Settings

  • Channel Policies: Managing communications
  • Guest Meeting Settings: Securing external access
  • File Policies: Controlling content sharing

SharePoint Online - Security

  • Access Requests: Approval processes
  • External Sharing: Security levels
  • Storage Entities: Configuring spaces
×

Security and Compliance

DLP policies and automatic classification rules require special attention when comparing configurations between tenants.

Technical Terms Glossary

Configuration as Code (CaC): An infrastructure management approach where configurations are defined via versioned code.

PowerShell DSC: Desired State Configuration - Microsoft framework for managing system configuration declaratively.

Blueprint: A reference configuration template containing best practices and explanatory metadata.

Drift: Configuration drift - The gap between desired state and current state of a configuration.

Cross-tenant: Relating to interactions and migrations between different Microsoft 365 tenants.

Delta Report: A difference report highlighting discrepancies between two configurations.

Useful Links and Documentation

  • Official Microsoft365DSC Documentation
  • Microsoft365DSC GitHub Repository
  • Microsoft PowerShell DSC Guide
  • Microsoft 365 Security Blueprints
  • Microsoft 365 Compliance Center

Conclusion

Microsoft365DSC revolutionizes comparative management of Microsoft 365 configurations. This free tool transforms a complex and time-consuming task into an automated and reliable process. Whether for migrations, security audits, or establishing best practices, Microsoft365DSC has become essential for modern Microsoft 365 administrators.

The integration of blueprints with contextual metadata further elevates this solution, offering not only drift detection but also improvement recommendations. Adopt this "Configuration as Code" approach now for proactive management of your Microsoft 365 environments.

Share:
HM

Houssem MAKHLOUF

Microsoft 365 enthusiast & IT professional.

Previous article

OneDrive: Fix Automatic Sign-In After Autopilot with Intune

Mar 10, 2026
Next article

Microsoft 365 Backup: Granular Restore for SharePoint and OneDrive Files

Mar 10, 2026

Related articles

Exécution de scripts PowerShell pour auditer des applications AI et gérer leurs enregistrements.copilot

Audit and Manage AI Applications with PowerShell

Audit unauthorized AI applications in Entra ID with PowerShell and Microsoft Graph to strengthen control and security.

Jun 28, 20264 min
Graphiques abstraits et géométriques avec des couches de couleurs translucides.exchange

Converting Exchange IDs for Microsoft 365 Graph API

Convert Exchange identifiers (storeId, entryId, RestId) for Graph API and targeted eDiscovery. Technical guide with complete PowerShell scripts.

Jun 28, 20267 min
Pyramide réfléchissante au centre de réseaux de fils dorés et cercles.azure

Graph Delta Queries for Entra ID Groups

Learn how to use Graph Delta Queries for Entra ID groups to track changes in real-time. Tutorials and scripts included.

Jun 27, 20264 min