Get-MgApplicationOwnerCount

What is Get-MgApplicationOwnerCount?

Get-MgApplicationOwnerCount is a Microsoft Graph PowerShell cmdlet that returns the number of owners assigned to a specific Azure AD (Entra ID) application. Instead of listing owners one by one, it gives you a quick numeric count.

🚀 Community Edition Released!

Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.

Why Use Get-MgApplicationOwnerCount?

This cmdlet is super handy for automation and governance. With one line, you can:

  • Audit apps to ensure every application has at least one responsible owner.
  • Flag risky apps with zero owners (common in legacy or abandoned registrations).
  • Build compliance scripts that track owner counts across hundreds of apps without exporting large datasets.
  • Combine the count with filters to validate ownership rules in bulk.

Prerequisites

Before using the cmdlet, connect to Microsoft Graph with the right permissions:

  • Install the module (if needed):
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect with an app/owner read scope (typically):
    Connect-MgGraph -Scopes "Application.Read.All"

Also note: -ConsistencyLevel "Eventual" is required for count and advanced queries in Graph PowerShell.


How to use Get-MgApplicationOwnerCount?

Basic syntax (count requires consistency level):

Get-MgApplicationOwnerCount -ApplicationId <String> -ConsistencyLevel <String>

You pass the ApplicationId of the app registration, and Graph returns the number of owners. Optionally, use -Filter to count owners matching a specific condition.


Get-MgApplicationOwnerCount Examples

  • Example 1: Get the Total Count of Owners for an Application
  • Get-MgApplicationOwnerCount -ApplicationId "12345678-90ab-cdef-1234-567890abcdef" -ConsistencyLevel "Eventual"

    This returns a single number showing how many owners are tagged on that application.

  • Example 2: Filter Application Owner Count By Application Owner Display Name
  • Get-MgApplicationOwnerCount -ApplicationId "12345678-90ab-cdef-1234-567890abcdef" -ConsistencyLevel "Eventual" -Filter "displayName eq 'John Doe'"

    This counts only the owners whose display name matches John Doe, useful for verifying specific ownership assignments.


Summary

Key Point Details
Cmdlet Name Get-MgApplicationOwnerCount
Purpose Counts the number of owners assigned to an Entra ID application
Required Scope Application.Read.All (or higher)
Primary Parameters ApplicationId, ConsistencyLevel, Filter (optional)
Automation Benefit Enables fast ownership audits across many apps
Use Case Detecting apps with zero owners, validating compliance rules

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