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.
Ensure that Microsoft Graph PowerShell module is installed. If not, install it using this script:
Install-Module Microsoft.Graph -Scope CurrentUser
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>]
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. |
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: