Tracking Microsoft 365 app usage is crucial for organizations looking to optimize licensing, monitor app adoption, and better understand user activity. The Get-MgReportM365AppUserCount cmdlet provides a convenient way to extract this data, enabling administrators to generate usage reports directly from Microsoft Graph PowerShell. This article explores the cmdlet’s syntax, showing how to generate app usage reports, and walks through its usage and common errors.
Get-MgReportM365AppUserCount -Period <String> -OutFile <String>
Parameters:
This is the most common way to run the cmdlet, where both parameters are defined upfront.
Get-MgReportM365AppUserCount -Period D30 -Outfile C:/Users/d/Downloads/M365AppUsageReport.csv
This example generates a report for the last 30 days (D30) and saves it to the specified path.
If you run the cmdlet without specifying parameters, it will prompt you to input them interactively:
Get-MgReportM365AppUserCount
The console will ask for:
Error | Cause | Solution |
Invalid Period Parameter | The -Period parameter accepts values up to D180. Specifying a period beyond that (e.g., D270) will cause this error. | Ensure that the period is within the allowed range (D1 to D180). |
Access Denied or Insufficient Permissions | The user running the cmdlet does not have the necessary permissions. | Make sure that the user has been granted the Reports.Read.All permission through Microsoft Graph. |
Invalid File Path | The -Outfile parameter specifies an invalid or inaccessible file path | Ensure the file path exists and the user has write access to the directory. For example, double-check the C:/Users/d/Downloads directory in the usage examples. |
File in Use | If the output file is already open or being used by another program (like Excel), the cmdlet will not be able to write to it. | Ensure the target file is not in use when you run the cmdlet, or specify a different file name. |
The Get-MgReportM365AppUserCount cmdlet is a powerful tool for Microsoft 365 administrators who need insights into application usage across their tenant. Whether you're monitoring app adoption, optimizing licenses, or conducting compliance audits, this cmdlet provides a straightforward way to generate usage reports. By understanding the cmdlet’s syntax, using it correctly, and handling possible errors, you can streamline reporting and ensure accurate data collection.
© m365corner.com. All Rights Reserved. Design by HTML Codex