aad m365group user list
Lists users for the specified Microsoft 365 group
Usage
m365 aad m365group user list [options]
Options
-i, --groupId <groupId>
The ID of the Microsoft 365 group for which to list users
-r, --role [role]
Filter the results to only users with the given role:
Owner
,Member
,Guest
-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
List all users and their role in the specified Microsoft 365 group
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000'
List all owners and their role in the specified Microsoft 365 group
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' --role Owner
List all guests and their role in the specified Microsoft 365 group
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' --role Guest
Response
- JSON
- Text
- CSV
- Markdown
[
{
"id": "da52218e-4822-4ac6-b41d-255e2059655e",
"displayName": "Adele Vance",
"userPrincipalName": "AdeleV@contoso.OnMicrosoft.com",
"userType": "Member"
}
]
id displayName userPrincipalName userType
------------------------------------ -------------------- ------------------------------------ --------
da52218e-4822-4ac6-b41d-255e2059655e Adele Vance AdeleV@contoso.OnMicrosoft.com Member
id,displayName,userPrincipalName,userType
da52218e-4822-4ac6-b41d-255e2059655e,Adele Vance,AdeleV@contoso.OnMicrosoft.com,Member
# aad m365group user list --groupId "1deaa428-8dde-4043-b028-5492226d6114"
Date: 2023-06-02
## Adele Vance (da52218e-4822-4ac6-b41d-255e2059655e)
Property | Value
---------|-------
id | da52218e-4822-4ac6-b41d-255e2059655e
displayName | Adele Vance
userPrincipalName | AdeleV@contoso.OnMicrosoft.com
userType | Member