Automatically monitor and report Microsoft Teams without owners through PowerShell automation.
- 🔐 Secure Microsoft Graph authentication
- 🔍 Teams ownership monitoring
- 📊 Customizable HTML reporting
- 📧 Automated email notifications
- 📦 Modular architecture
- PowerShell 5.1 or higher
- Microsoft Graph PowerShell SDK
- Azure AD App Registration with appropriate permissions
Your Azure AD App needs the following Microsoft Graph API permissions:
Directory.Read.All
Group.Read.All
TeamMember.Read.All
Team.ReadBasic.All
Install-Module Microsoft.Graph -Scope CurrentUser
git clone https://github.com/fabayram/teams-owner-report.git
cd teams-owner-report
Edit config.json
to match your environment:
{
"MicrosoftGraph": {
"ClientId": "your-client-id",
"TenantId": "your-tenant-id",
"ClientSecret": "your-client-secret",
"AppName": "your-app-name"
},
"SMTP": {
"Server": "smtp.yourdomain.com",
"From": "[email protected]",
"Recipients": ["[email protected]"]
}
}
.\TeamsOwnerReport.ps1
.
└── src/
├── TeamsOwnerReport.ps1 # Main script
├── Functions.ps1 # Core functions
├── config.json # Configuration
├── EmailTemplate.xml # Email template
└── README.md # Documentation
Function | Description |
---|---|
Get-Config |
Configuration manager |
Connect-MicrosoftGraph |
Graph authentication |
Get-TeamsWithoutOwners |
Teams monitoring |
Generate-HTMLReport |
Report generation |
Send-Email |
Email distribution |
# Verify connection
Connect-MgGraph -ClientId $config.ClientId -TenantId $config.TenantId
# Test email settings
Send-MailMessage -SmtpServer $config.SmtpServer -From $config.From -To $config.Recipients -Subject "Test"
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Fatih BAYRAM
GitHub: @fabayram
LinkedIn: @fbayram
Made with ❤️ for the community
If you like this project, please consider giving it a ⭐!