How to find groups associated with a contact using Microsoft Graph PowerShell

Identifying the groups that a contact is a member of helps administrators understand their resource access levels. This insight helps ensure security and aids in fixing access issues. Microsoft Graph PowerShell helps you find the groups that a contact is associated with using the Get-MgContactMemberOf cmdlet.

Finding a contact's associated groups using Microsoft Graph PowerShell

Prerequisites

Ensure that Microsoft Graph PowerShell module is installed. If not, install it using this script:

Install-Module Microsoft.Graph -Scope CurrentUser

Using the Get-MgContactMemberOf cmdlet

Run the following commands in Microsoft Graph PowerShell to find the groups that a contact is a member of:

Get-MgContactMemberOf
-OrgContactId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[]>]
[-Top <Int32>]
[-ConsistencyLevel <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]

Supported parameters

The following table contains some parameters that can be used along with the Get-MgContactMemberOf cmdlet to find the groups that a contact is a member of.

Parameters Description
-All Lists all pages.
-ConsistencyLevel Indicates the requested consistency level.
-CountVariable Specifies a count of the total number of items in a collection.
-ExpandProperty Expands related entities.
-Filter Filters items by property values.

Limitations of using Microsoft Graph PowerShell to find groups associated with a contact

  • PowerShell scripts can get complicated with different use cases and scenarios.
  • IT admins can spend a lot of time debugging errors, which in turn negatively impacts productivity.
  • Delegation can get tricky since technicians require elevated permissions.

Manage Microsoft Entra ID contacts and groups with ADManager Plus

Say goodbye to complicated PowerShell scripts with ADManager Plus, an identity governance and administration solution. ADManager Plus' comprehensive Microsoft Entra ID management and reporting simplifies complex admin tasks from a single, user-friendly console:

  • Manage users, contacts, groups, licences, and other Microsoft Entra ID objects with a script-free, centralized console.
  • Reduce human errors by automating and orchestrating tasks such as user provisioning, deprovisioning, and license assignment across various platforms.
  • Delegate tasks to technicians without elevating their native privileges.
  • Keep a watchful eye on your IT environment with more than 200 prepackaged reports.
  • Monitor delegated activities through smart workflows.
  • Ensure business continuity with AD, Microsoft Entra ID, and Google Workspace backup and recovery.

Perform script-free Microsoft Entra ID management and reporting with ADManager Plus

 
  • Finding a contact's associated groups using Microsoft Graph PowerShell
  • Limitations of using Microsoft Graph PowerShell to find groups associated with a contact
  • Manage Microsoft Entra ID contacts and groups with ADManager Plus
The one-stop solution to Active Directory Management and Reporting
Email Download Link