entra user groupmembership list
Retrieves all groups where the user is a member of
Usage
m365 entra user groupmembership list [options]
Options
-i, --userId [userId]
The ID of the user to retrieve information for. Use either
userId
,userName
oruserEmail
, but not multiple.-n, --userName [userName]
The name of the user to retrieve information for. Use either
userId
,userName
oruserEmail
, but not multiple.-e, --userEmail [userEmail]
The email of the user to retrieve information for. Use either
userId
,userName
oruserEmail
, but not multiple.--securityEnabledOnly [securityEnabledOnly]
Specifies that only security-enabled groups that the user is a member of should be returned
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Examples
Retrieves groups that the user is a member of
m365 entra user groupmembership list --userId '1caf7dcd-7e83-4c3a-94f7-932a1299c844'
Retrieves only security groups that the user is a member of
m365 entra user groupmembership list --userName 'john.doe@contoso.com' --securityEnabledOnly
Retrieves groups where the currently logged user is a member of
m365 entra user groupmembership list --userId '@meId'
Retrieves groups where the currently logged user is a member of
m365 entra user groupmembership list --userName '@meUserName'
Response
- JSON
- Text
- CSV
- Markdown
[
{
"groupId": "01b62bc5-9701-4f93-9587-9d1ea58a086d"
},
{
"groupId": "619701a2-4bdc-494a-a9dd-9d3aeebcafd9"
},
{
"groupId": "ec98d904-ac8c-49f0-99e1-c9c0e1a1e453"
}
]
groupId
------------------------------------
01b62bc5-9701-4f93-9587-9d1ea58a086d
619701a2-4bdc-494a-a9dd-9d3aeebcafd9
ec98d904-ac8c-49f0-99e1-c9c0e1a1e453
groupId
01b62bc5-9701-4f93-9587-9d1ea58a086d
619701a2-4bdc-494a-a9dd-9d3aeebcafd9
ec98d904-ac8c-49f0-99e1-c9c0e1a1e453
# entra user groupmembership list --userId "1f5595b2-aa07-445d-9801-a45ea18160b2"
Date: 5/17/2024
Property | Value
---------|-------
groupId | 01b62bc5-9701-4f93-9587-9d1ea58a086d
Property | Value
---------|-------
groupId | 619701a2-4bdc-494a-a9dd-9d3aeebcafd9
Property | Value
---------|-------
groupId | ec98d904-ac8c-49f0-99e1-c9c0e1a1e453