Skip to content

physicsy/Office365-PowerScript

Repository files navigation

Office365-PowerScript

A comprehensive PowerShell script collection for Microsoft 365 administration and reporting.

πŸ“š Table of Contents

πŸš€ Quick Start

  1. Clone the repository

    git clone https://github.com/physicsy/Office365-PowerScript.git
    cd Office365-PowerScript
  2. Install required module

    Install-Module Microsoft.Graph -Scope CurrentUser -Force
  3. Choose a topic and follow its README for specific instructions

πŸ“‚ Topics/Scripts

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


Generate application usage reports and group membership analytics.

Usage: .\AppUsageReport\AppUsage.ps1


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.


πŸ“¦ Installation

Prerequisites

  • PowerShell 5.1 or higher
  • Windows 10/11 or Windows Server 2016+
  • Microsoft.Graph module (or Exchange Online Module depending on script)

Module Installation

Microsoft Graph (Recommended)

Install-Module Microsoft.Graph -Scope CurrentUser -Force

For script-specific requirements, check the individual topic README.

πŸ“– Documentation

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

πŸ”‘ Common Authentication

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.

βš™οΈ Configuration

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.

πŸ“‹ Example Input Format

Standard CSV format for most scripts:

EmailAddress
user1@contoso.com
user2@contoso.com
user3@contoso.com

πŸ› Troubleshooting

Module Not Found

Get-Module -Name Microsoft.Graph -ListAvailable
Update-Module Microsoft.Graph

Authentication Issues

# Clear cached tokens
Remove-Item -Path "$env:USERPROFILE\.azure\msal_token_cache.json" -Force

Permission Denied

  • 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.

β˜• Support & Donations

If you find Office365-PowerScript helpful, please consider supporting the project:

Ways to Support

Option Link
πŸ™ GitHub Sponsors GitHub Sponsors
πŸ’³ PayPal PayPal
πŸ’³ Indian UPI UPI
⭐ Star the Repo Add a star

Other Ways to Help

  • πŸ› 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

🀝 Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

See CONTRIBUTING.md for detailed guidelines.

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file for details.

⚠️ Disclaimer

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

About

Clean and direct: Office 365 automation with PowerShell

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors