M365CertAuth

1.2.5

Certificate-based authentication module for Microsoft 365 PowerShell modules. Automates certificate creation, app registration, permission assignment, and provides ready-to-use certificates for all M365 services. Features tenant management with secure storage and selection menus. Requires Microsoft Graph PowerShell modules for Azure AD operations.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name M365CertAuth -RequiredVersion 1.2.5

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name M365CertAuth -Version 1.2.5

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2025 PowerShell Community. All rights reserved.

Package Details

Author(s)

  • PowerShell Community

Tags

Microsoft365 Azure Certificate Authentication Exchange SharePoint Graph PowerShell TenantManagement MultiTenant

Functions

Get-CertificateForAuth Show-CertificateAuthHelp Get-StoredTenants Show-StoredTenants Remove-StoredTenant Clear-StoredTenants

Dependencies

This module has no dependencies.

Release Notes

Version 1.2.5
- Fixed critical null reference error in SharePoint tenant detection
- Implemented proper SharePoint tenant URL detection using Get-MgSite root query
- Replaced unreliable domain pattern matching with direct Microsoft Graph API calls
- Improved error handling and removed complex fallback methods
- Enhanced SharePoint tenant name extraction for accurate admin URL generation

Version 1.2.4
- Fixed tenant storage array conversion issues
- Improved multi-tenant support (up to 20 tenants)
- Enhanced tenant selection menu with count display
- Streamlined authentication flow
- Clean session management to prevent wrong tenant operations

Version 1.2.3
- Removed fallback encryption methods for cleaner, more secure implementation
- Simplified encryption logic with proper assembly loading
- Enhanced help examples to use module-provided values (no more hardcoded placeholders)
- Improved connection examples with actual tenant properties

Version 1.2.2
- Fixed compatibility issue with System.Security.Cryptography.ProtectedData
- Added proper assembly loading for encryption support
- Updated help examples to use actual module-provided values instead of placeholders
- Enhanced connection examples with real tenant information

Version 1.2.1
- Enhanced help documentation with detailed tenant management workflow
- Improved function descriptions and usage examples
- Updated manifest to indicate Microsoft Graph dependencies
- Refined tenant management command documentation

Version 1.2.0
- Added tenant management with secure encrypted storage
- Automatic tenant selection menu for multi-tenant environments
- Certificate-based authentication bypass for stored tenants
- New functions: Get-StoredTenants, Show-StoredTenants, Remove-StoredTenant, Clear-StoredTenants
- Enhanced certificate validation and expiry handling for stored connections
- Supports up to 20 stored tenants with automatic cleanup
- Improved user experience with minimal login prompts

Version 1.1.2
- Removed emojis and glyphs from output for better compatibility across terminals
- Improved console output formatting with standard text characters

Version 1.1.1
- Added SharePointTenantName property for correct SharePoint URL detection
- Enhanced domain detection logic for multi-tenant scenarios

Version 1.1.0
- Added tenant information to return object (TenantName, PrimaryDomain, InitialDomain)
- Enhanced module to provide all necessary tenant context for consuming scripts
- Eliminates need for scripts to call Get-MgDomain themselves

Version 1.0.4
- Code cleanup and optimization
- Removed unnecessary validation checks that caused false warnings
- Streamlined module structure

Version 1.0.3
- Documentation cleanup and version update

Version 1.0.2
- Improved role assignment approach for better compatibility
- Added service principal propagation delay for better reliability
- Made Global Administrator role assignment optional with graceful failure handling
- Enhanced error handling to use warnings instead of hard failures

Version 1.0.1
- Fixed Exchange Online App-Only authentication by adding Exchange Administrator role assignment
- Enhanced role validation for existing app registrations
- Improved error handling for directory role assignments

Version 1.0.0
- Initial release
- Automated certificate creation and management
- App registration with comprehensive permissions
- Support for Exchange Online, SharePoint, Microsoft Graph, Teams, Azure, and Security & Compliance
- Enterprise-grade certificate validation and duplicate detection
- Automatic expired certificate cleanup
- Built-in help system with connection examples

FileList

Version History

Version Downloads Last updated
1.2.20 17 7/15/2026
1.2.16 125 2/27/2026
1.2.15 23 2/10/2026
1.2.8 15 12/12/2025
1.2.7 7 12/11/2025
1.2.6 10 10/22/2025
1.2.5 (current version) 10 9/8/2025
1.2.4 16 9/5/2025
1.2.3 10 9/4/2025
1.2.1 9 9/4/2025
1.2.0 6 9/4/2025
1.1.2 9 9/4/2025
1.1.1 12 9/3/2025
1.1.0 7 9/3/2025
1.0.4 8 9/3/2025
1.0.3 7 9/3/2025
1.0.2 7 9/3/2025
1.0.1 7 9/3/2025
1.0.0 9 9/3/2025
Show less