forked from pnp/cli-microsoft365
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extends 'aad m365group user list' command with extra options and depr…
…ecation. Closes pnp#5557
- Loading branch information
Showing
3 changed files
with
353 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,33 +15,52 @@ m365 aad m365group user list [options] | |
## Options | ||
|
||
```md definition-list | ||
`-i, --groupId <groupId>` | ||
: The ID of the Microsoft 365 group for which to list users | ||
`-i, --groupId [groupId]` | ||
: The ID of the Microsoft 365 group. Specify `groupId` or `groupDisplayName` but not both. | ||
|
||
`-n, --groupDisplayName [groupDisplayName]` | ||
: The display name of the Microsoft 365 group. Specify `groupId` or `groupDisplayName` but not both. | ||
|
||
`-r, --role [role]` | ||
: Filter the results to only users with the given role: `Owner`, `Member`, `Guest` | ||
: Filter the results to only users with the given role. Allowed values: `Owner`, `Member`, or (Deprecated) `Guest`. | ||
|
||
`-p, --properties [properties]` | ||
: Comma-separated list of properties to retrieve. | ||
|
||
`-f, --filter [filter]` | ||
: OData filter to use to query the list of users with. | ||
``` | ||
|
||
<Global /> | ||
|
||
## Remarks | ||
|
||
When the `properties` option includes values with a `/`, for example: `manager/displayName`, an additional `$expand` query parameter will be included on `manager`. | ||
|
||
## Examples | ||
|
||
List all users and their role in the specified Microsoft 365 group | ||
List all users and their role from Microsoft 365 group specified by ID. | ||
|
||
```sh | ||
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' | ||
m365 aad m365group user list --groupId 00000000-0000-0000-0000-000000000000 | ||
``` | ||
|
||
List all owners from Microsoft 365 group specified by display name. | ||
|
||
``` | ||
m365 aad m365group user list --groupDisplayName Developers --role Owner | ||
``` | ||
|
||
List all owners and their role in the specified Microsoft 365 group | ||
List specific properties for all group users from a group specified by ID. | ||
|
||
```sh | ||
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' --role Owner | ||
m365 aad m365group user list --groupId 03cba9da-3974-46c1-afaf-79caa2e45bbe --properties "id,jobTitle,companyName,accountEnabled" | ||
``` | ||
|
||
List all guests and their role in the specified Microsoft 365 group | ||
List all group members that are guest users. | ||
|
||
```sh | ||
m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' --role Guest | ||
m365 aad m365group user list --groupDisplayName Developers --filter "userType eq 'Guest'" | ||
``` | ||
|
||
## Response | ||
|
@@ -55,7 +74,12 @@ m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' -- | |
"id": "da52218e-4822-4ac6-b41d-255e2059655e", | ||
"displayName": "Adele Vance", | ||
"userPrincipalName": "[email protected]", | ||
"userType": "Member" | ||
"givenName": "Adele", | ||
"surname": "Vance", | ||
"roles": [ | ||
"Owner", | ||
"Member" | ||
] | ||
} | ||
] | ||
``` | ||
|
@@ -64,17 +88,17 @@ m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' -- | |
<TabItem value="Text"> | ||
|
||
```text | ||
id displayName userPrincipalName userType | ||
------------------------------------ -------------------- ------------------------------------ -------- | ||
da52218e-4822-4ac6-b41d-255e2059655e Adele Vance [email protected] Member | ||
id displayName userPrincipalName userType roles | ||
------------------------------------ -------------------- ------------------------------------ -------- -------- | ||
da52218e-4822-4ac6-b41d-255e2059655e Adele Vance [email protected] Owner,Member Owner,Member | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="CSV"> | ||
|
||
```csv | ||
id,displayName,userPrincipalName,userType | ||
da52218e-4822-4ac6-b41d-255e2059655e,Adele Vance,[email protected],Member | ||
id,displayName,userPrincipalName,givenName,surname,userType | ||
da52218e-4822-4ac6-b41d-255e2059655e,Adele Vance,[email protected],Adele,Vance,Member | ||
``` | ||
|
||
</TabItem> | ||
|
@@ -91,6 +115,8 @@ m365 aad m365group user list --groupId '00000000-0000-0000-0000-000000000000' -- | |
---------|------- | ||
id | da52218e-4822-4ac6-b41d-255e2059655e | ||
displayName | Adele Vance | ||
givenName | Adele | ||
surname | Vance | ||
userPrincipalName | [email protected] | ||
userType | Member | ||
``` | ||
|
Oops, something went wrong.