Get-MgUserCalendarCount

What is Get-MgUserCalendarCount?

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.


Why Use Get-MgUserCalendarCount?

This cmdlet is primarily used for auditing, reporting, and automation in large organizations. It helps administrators:

  • Determine how many calendars each user maintains.
  • Identify inactive or excessive calendar creation patterns.
  • Support automated mailbox and calendar management scripts.

It’s especially useful when building automated workflows for Microsoft 365 user data audits or cleanup operations.


Prerequisites

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"

How to Use Get-MgUserCalendarCount?

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.


Get-MgUserCalendarCount Examples

Example 1: Retrieve the Total Calendar Count for a Specific User

This example retrieves the total number of calendars belonging to a specific user.

Get-MgUserCalendarCount -UserId "john.doe@company.com"

Example 2: Retrieve the Calendar Count with a Specific Filter

This example filters calendars by a specific name or property.

Get-MgUserCalendarCount -UserId "john.doe@company.com" -Filter "name eq 'Work Calendar'"

Summary

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