A comprehensive PowerShell script collection for Microsoft 365 administration and reporting.
-
Clone the repository
git clone https://github.com/physicsy/Office365-PowerScript.git cd Office365-PowerScript -
Install required module
Install-Module Microsoft.Graph -Scope CurrentUser -Force
-
Choose a topic and follow its README for specific instructions
Extract and report on all group memberships for specified users. Handles cloud groups, distribution lists, and on-premises synced groups.
Key Features:
- User group membership extraction
- Group type identification (Unified, Distribution List, Security, etc.)
- Membership type detection (Dynamic vs Assigned)
- Email address resolution
- Source identification (Cloud vs Windows AD)
Usage: .\GroupMemberSghip\groupMemberShip.ps1
Generate reports of user last successful sign-in dates and license information.
Usage: .\M365UsersLastSuccessfulSigninReport\M365UsersLastSuccessfulSigninReport.ps1
Collection of Microsoft Graph API utilities for various M365 operations.
Includes:
- Cloud/On-Premises analysis
- Mailbox delegation reports
- Proxy address management
- Extension attributes
- Teams and Groups management
Azure AD Connect and tenant discovery utilities.
Usage: .\AD_Connect\Ad_Connect_script.ps1
π± App Usage Reports
Generate application usage reports and group membership analytics.
Usage: .\AppUsageReport\AppUsage.ps1
π Migration Tools
Scripts for migrating on-premises resources to Microsoft 365.
Includes:
- Mailbox migrations
- Proxy address updates
- Domain attribute updates
- Distribution list swapping
Manage password policies for user accounts.
Manage group extensions and membership operations.
Comprehensive tenant migration discovery and planning tools.
Temporary and utility scripts for various tasks.
- PowerShell 5.1 or higher
- Windows 10/11 or Windows Server 2016+
- Microsoft.Graph module (or Exchange Online Module depending on script)
Microsoft Graph (Recommended)
Install-Module Microsoft.Graph -Scope CurrentUser -ForceFor script-specific requirements, check the individual topic README.
| Document | Description |
|---|---|
| REQUIREMENTS.md | Detailed module and version requirements |
| QUICKSTART.md | 5-minute getting started guide |
| SECURITY.md | Security best practices and guidelines |
| CONTRIBUTING.md | How to contribute to this project |
| CHANGELOG.md | Version history and updates |
Most scripts use Modern Authentication via Microsoft Graph:
Connect-MgGraph -Scopes "User.Read.All", "Group.Read.All", "Directory.Read.All"You'll be prompted to authenticate with your M365 admin account.
Each script can be customized by editing the configuration variables:
$CsvPath = "C:\M365\Input\input.csv"
$OutputFilePath = "C:\M365\Output\report.csv"Refer to individual script README files for specific configuration options.
Standard CSV format for most scripts:
EmailAddress
user1@contoso.com
user2@contoso.com
user3@contoso.comGet-Module -Name Microsoft.Graph -ListAvailable
Update-Module Microsoft.Graph# Clear cached tokens
Remove-Item -Path "$env:USERPROFILE\.azure\msal_token_cache.json" -Force- Ensure your account has M365 admin rights
- Verify required Graph API scopes
- Check app registration permissions (if using application-based auth)
For more help, see SECURITY.md and individual topic READMEs.
If you find Office365-PowerScript helpful, please consider supporting the project:
| Option | Link |
|---|---|
| π GitHub Sponsors | |
| π³ PayPal | |
| π³ Indian UPI | |
| β Star the Repo | Add a star |
- π Report issues with detailed information
- π‘ Suggest improvements and new features
- π¨βπ» Contribute code and documentation
- π’ Share the project with your network
π See SUPPORT.md for more details
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
These scripts are provided as-is. Test thoroughly in a non-production environment before using in production. Always maintain backups before running any modification scripts.
Last Updated: April 2026
Repository: GitHub - physicsy/Office365-PowerScript