We've created these specs because there was a confusion with the current implementation of aad m365group user list around member roles and user types. userType (Members VS Guests) is an AAD related user property, while Owners VS Members is the role the user has in the group.
The change described in this issue deprecates the Guest value of the role option, which will be removed in the next major version.
It also adds extra options to get the right user list and aligns the command with the aad group user list command.
The updates:
Options
| Option |
Description |
-r, --role [role] |
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. |
Examples
List specific properties for all group users from a group specified by ID
m365 aad m365group user list --groupId 03cba9da-3974-46c1-afaf-79caa2e45bbe --properties 'id,jobTitle,companyName,accountEnabled'
List all owners from a group specified by display name
m365 aad m365group user list --groupDisplayName Developers --role Owner
List all group members that are guest users
m365 aad m365group user list --groupDisplayName Developers --filter "userType eq 'Guest'"
Default properties
- id
- displayName
- userPrincipalName
- userType (will be removed as default property in the next major version)
- roles (custom property)
Additional Info
-
in the api call we $select the userName, id, displayName, given name and surname and userType by default.
-
When using the --properties option, default properties will not be added to the $select parameter, unless mentioned
-
Just like in similar commands, using a property with a slash should translate to an added $expand-parameter.
-
we add a roles property to the items in the response output to show that users are member, owner or both.
More information
View the documentation to see what userproperties can be included: https://pnp.github.io/cli-microsoft365/cmd/aad/user/user-get#more-information
We've created these specs because there was a confusion with the current implementation of
aad m365group user listaround member roles and user types. userType (Members VS Guests) is an AAD related user property, while Owners VS Members is the role the user has in the group.The change described in this issue deprecates the
Guestvalue of the role option, which will be removed in the next major version.It also adds extra options to get the right user list and aligns the command with the
aad group user listcommand.The updates:
Options
-r, --role [role]Owner,Memberor (Deprecated)Guest.-p, --properties [properties]-f, --filter [filter]Examples
List specific properties for all group users from a group specified by ID
m365 aad m365group user list --groupId 03cba9da-3974-46c1-afaf-79caa2e45bbe --properties 'id,jobTitle,companyName,accountEnabled'List all owners from a group specified by display name
List all group members that are guest users
m365 aad m365group user list --groupDisplayName Developers --filter "userType eq 'Guest'"Default properties
Additional Info
in the api call we $select the userName, id, displayName, given name and surname and userType by default.
When using the
--propertiesoption, default properties will not be added to the$selectparameter, unless mentionedJust like in similar commands, using a property with a slash should translate to an added
$expand-parameter.we add a
rolesproperty to the items in the response output to show that users are member, owner or both.More information
View the documentation to see what userproperties can be included: https://pnp.github.io/cli-microsoft365/cmd/aad/user/user-get#more-information