The Get-MgUserCalendarCount cmdlet retrieves the total number of calendars a user has within their Microsoft 365 account. It’s part of the Microsoft Graph PowerShell module and helps administrators quickly determine the number of calendars created or managed by a user in Outlook or other integrated Microsoft 365 apps.
This cmdlet is primarily used for auditing, reporting, and automation in large organizations. It helps administrators:
It’s especially useful when building automated workflows for Microsoft 365 user data audits or cleanup operations.
Before using this cmdlet, install the Microsoft Graph module and connect with the required permissions:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Calendars.Read"
Use the -UserId parameter to specify the user’s unique ID or User Principal Name (UPN).
Get-MgUserCalendarCount -UserId <String>
This retrieves the total number of calendars associated with the specified user.
This example retrieves the total number of calendars belonging to a specific user.
Get-MgUserCalendarCount -UserId "john.doe@company.com"
This example filters calendars by a specific name or property.
Get-MgUserCalendarCount -UserId "john.doe@company.com" -Filter "name eq 'Work Calendar'"
| Key Point | Details |
|---|---|
| Cmdlet Name | Get-MgUserCalendarCount |
| Purpose | Retrieves the total number of calendars for a specific user |
| Required Scope | Calendars.Read |
| Primary Parameter | UserId, Filter |
| Automation Benefit | Enables administrators to monitor, audit, and report user calendar counts |
| Use Case | Useful for calendar inventory, mailbox audits, and administrative reporting |
Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.
Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.
© Your Site Name. All Rights Reserved. Design by HTML Codex