Overview
This PowerShell script exports Microsoft 365 usage reports using the Microsoft Graph API and the Exchange Online Management PowerShell Module. The results are saved locally and can also be sent by email.
The reports that can be exported using this script are:
- Assigned Licenses Report Count
- Exchange
- SharePoint
- OneDrive
- Skype for Business
- Teams
- Yammer
- Microsoft 365
- Exchange Reports
- Mailbox Status (Active/Inactive)
- Mailbox Provisioning (Created/Deleted)
- Mailbox Quota
- Email App Usage
- Office 365 Groups Provisioning
- Mail Traffic (Inbound/Outbound)
- Spam and Malware Detection (Count)
- ATP Mail Detection (ATP Safe Links, ATP Safe Attachments)
- Top 10 Mail Senders
- Top 10 Mail Recipients
- Top 10 Spam Recipients
- Top 10 Malware Recipients
- Top 10 Malware Detected
- SharePoint Reports
- Total, Active, Inactive Sites
- Storage Used (Tenant)
- OneDrive Reports
- Total, Active, Inactive Sites
- Storage Used (Tenant)
- Microsoft Teams
- Total Users
- Active Users
- Inactive Users
- Guest Users
- Total 1:1 Calls
- Total Channel Messages
- Total Private Chat Messages
- Total Meetings
- Total Audio Duration (minutes)
- Total Video Duration (minutes)
- Total Screen Sharing Duration (minutes)
- Device Usage Distribution
Requirements
For Automation and Unattended Jobs
For Manual and Interactive Use
- The logged-in user must be an Exchange administrator.
- The logged-in user must have Entra access to read the directory and reports, and have a valid Exchange Online mailbox if they plan to send the report by email.