New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New command: aad group user list
#5469
Comments
LGTM! Let's open it up. |
Can I work on this? |
Hi @milanholemans, Just wanted to check, how this command is different from aad m365group user list? Please correct, if I missed something. |
Hi @nanddeepn Yes, currently it is possible to run The |
I've updated the specs @milanholemans, @nanddeepn l, @pnp/cli-for-microsoft-365-maintainers. Thoughts? |
So this means that it looks something like this? {
"role": [ "Owner", "Member"]
} In that case, I'd call it Let's also add a link to the page where all possible User properties are listed like we do here: https://pnp.github.io/cli-microsoft365/cmd/aad/user/user-get#more-information |
@nanddeepn, we've reached a conclusion on the changed specs. Could you take this for a spin and update your PR? Do you have questions? Please let us know! |
Thank you @martinlingstuyl |
Hi @martinlingstuyl Similar discussion, we have going over here: #5424 |
Hi @nanddeepn, what's the reason the extra header is necessary? Have you researched that? |
Ok, i suggest we use the overloads idea that I've pitched in the other comment here as well. It may take some syncing between you and @SmitaNachan 😂. If you both commit the same code, we may get a merge conflict, but that's okay, we'll figure it out. Please do write this explanation in a comment above the line where you use the overload. We may refactor it back later, when the header is no longer needed here... |
@nanddeepn, @milanholemans, I've added an extra bullet below additional information:
Does this make sense to you? I also added an extra example |
I think it would make sense that only the provided properties would be retrieved; so, this explanation is unnecessary. But I can live with it 🙂 |
I agree it makes sense. But for clarifications sake! It will break the text output view, all would be empty. But that's okay. |
New specs
We've created new specs because there was a confusion with the old specs 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 changes specs:
Usage
m365 aad group user list [options]
Description
Lists users of a specific Azure AD group
Options
-i, --groupId [groupId]
groupId
orgroupDisplayName
but not both.-n, --groupDisplayName [groupDisplayName]
groupId
orgroupDisplayName
but not both.-r, --role [role]
Owner
orMember
.-p, --properties [properties]
-f, --filter [filter]
Examples
List all group users from a group specified by ID
List all owners from a group specified by display name
List specific properties for all group users from a group specified by ID
m365 aad group user list --groupId 03cba9da-3974-46c1-afaf-79caa2e45bbe --properties 'id,jobTitle,companyName,accountEnabled'
List all group members that are guest users
m365 aad group 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 by default.
When using the
--properties
option, default properties will not be added to the$select
parameter, unless mentionedJust 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
Old Specs
Usage
m365 aad group user list [options]
Description
Lists users of a specific Azure AD group
Options
-i, --groupId [groupId]
groupId
orgroupDisplayName
but not both.-n, --groupDisplayName [groupDisplayName]
groupId
orgroupDisplayName
but not both.-r, --role [role]
Owner
,Member
orGuest
.Examples
List all group users from a group specified by ID
List all owners from a group specified by display name
Default properties
Additional Info
userType
otherwise it will not be returned.The text was updated successfully, but these errors were encountered: