The Get-MgReportMailboxUsageDetail cmdlet is a useful tool for Microsoft 365 administrators to retrieve detailed reports on mailbox usage. This information is crucial for monitoring resource allocation, storage usage, and overall performance across the organization’s mailboxes.
Get-MgReportMailboxUsageDetail -Period <Int32> -OutFile <String>
Required Parameters:
Here’s an example of how to use the cmdlet to get a mailbox usage report for the past 90 days and export it to a CSV file:
Get-MgReportMailboxUsageDetail -Period 90 -OutFile "C:\Reports\MailboxUsageReport.csv"
This example generates a detailed report on mailbox usage over the past 90 days and saves it as a CSV file at the specified location.
This cmdlet retrieves detailed mailbox usage information for Microsoft 365 users, including storage size, item count, and last activity date. It helps administrators monitor mailbox growth and usage trends across the organization.
The -Period
parameter supports a maximum value of 180 days (D180). Using higher values like D270
or D365
results in an error. Always use supported durations such as D7
, D30
, D90
, or D180
.
No. The report generated by Get-MgReportMailboxUsageDetail
is organization-wide. However, you can filter the exported CSV file later in PowerShell or Excel to view a specific user’s data.
The mailbox usage data in Microsoft Graph reports is typically updated every 24 to 48 hours. This means recent mailbox activity might not appear instantly in the report.
Error | Cause | Solution |
InvalidPeriodValue | The Period parameter value is outside the permissible range (1-180 days). | Ensure that the Period value does not exceed 180. For example, a valid period would be -Period 180 , while an invalid one would be -Period 200 . Adjust the value to be within the allowed range. |
PathNotFoundException | The specified path in the OutFile parameter does not exist or is incorrect. | Verify that the directory specified in the OutFile path exists. You can create the directory manually or use PowerShell to create it: |
CommandNotFoundException | The Get-MgReportMailboxUsageDetail cmdlet is not recognized. | Ensure that you have installed and imported the Microsoft Graph PowerShell module: |
-Period
parameter in Get-MgReportMailboxUsageDetail
accepts values only up to 180 days.D270
) will return an error.D7
, D30
, D90
, or D180
for successful report generation.
-OutFile
parameter.Get-MgReportMailboxUsageDetail -Period D30 -OutFile "C:\Reports\MailboxUsage.csv"
This helps administrators perform detailed analysis or share mailbox activity reports across teams easily.
The Get-MgReportMailboxUsageDetail cmdlet is an indispensable tool for administrators who need detailed insights into mailbox usage across their Microsoft 365 environment. By regularly running this report, you can optimize performance, manage storage, and ensure compliance within your organization. Just remember to keep the Period parameter within the 1-180 day range and ensure your output file path is correct to avoid common errors.
With the right use of this cmdlet, mailbox management becomes streamlined, helping you make informed decisions about your organization’s mailboxes.
© m365corner.com. All Rights Reserved. Design by HTML Codex