cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

Enhancement: List all properties returned by Graph when using `m365 aad user list`

Open ValerasNarbutas opened this issue 1 year ago • 17 comments

Idea

Currently this command "m365 aad user list" return only userprincipalname and display name, would be great if it could return same number properties as graph API does by default.

Additional Info

one suggestion: from @Adam-it we could just modify this https://github.com/pnp/cli-microsoft365/blob/f8f3553c972f6064df03ea17e193be07b2b77d79/src/m365/aad/commands/user/user-list.ts#L57-L59 not to trim to ['userPrincipalName', 'displayName'];

ValerasNarbutas avatar Mar 20 '23 21:03 ValerasNarbutas

Great suggestion @ValerasNarbutas. To me it doesn't make much sense that we aren't returning all properties we retrieve from Graph. My suggestion would be, instead of introducing a new option, let's just return all properties from Graph when running m365 aad user list (so when no --properties option is passed).

milanholemans avatar Mar 20 '23 21:03 milanholemans

Great suggestion @ValerasNarbutas. To me it doesn't make much sense that we aren't returning all properties we retrieve from Graph. My suggestion would be, instead of introducing a new option, let's just return all properties from Graph when running m365 aad user list (so when no --properties option is passed).

totally agree, this is my first command example.. i have to do 2 examples as per requirement :D. A default return would be just enough.

ValerasNarbutas avatar Mar 20 '23 22:03 ValerasNarbutas

totally agree, this is my first command example.. i have to do 2 examples as per requirement :D. A default return would be just enough.

Yes that's because you used a new command issue template, while this isn't a new command but rather an enhancement. We don't have an enhancement template because it is quite hard to put it in a fixed template. Therefore you should actually use a blank issue to write down enhancements.

So for this enhancement, I don't think we need extra examples since we are only extending something that already exist.

milanholemans avatar Mar 20 '23 22:03 milanholemans

So for this enhancement,

ahh, thanks @milanholemans , i will do this next time!

ValerasNarbutas avatar Mar 20 '23 22:03 ValerasNarbutas

I've trimmed down your issue a bit (removed the unnecessary sections). If this looks good for you, we can start implementing it.

milanholemans avatar Mar 20 '23 22:03 milanholemans

I've trimmed down your issue a bit (removed the unnecessary sections). If this looks good for you, we can start implementing it.

nothing to add, thanks @milanholemans

ValerasNarbutas avatar Mar 20 '23 23:03 ValerasNarbutas

Just to give some extra context, this is not a breaking change because we will just enrich the output with extra properties that are returned by default by Graph. The already existing properties will still be there.

milanholemans avatar Mar 20 '23 23:03 milanholemans

Nice enhancement @ValerasNarbutas! It's indeed more logical that the command would return all the available properties instead of trimming it.

Do you want to work on this issue?

Jwaegebaert avatar Mar 21 '23 08:03 Jwaegebaert

Nice enhancement @ValerasNarbutas! It's indeed more logical that the command would return all the available properties instead of trimming it.

Do you want to work on this issue?

with pleasure :) @Jwaegebaert i just need my previous pull request merged, the one for typos.

ValerasNarbutas avatar Mar 21 '23 09:03 ValerasNarbutas

Awesome! The issue is all yours 🚀

Jwaegebaert avatar Mar 21 '23 09:03 Jwaegebaert

with pleasure :) @Jwaegebaert i just need my previous pull request merged, the one for typos.

One small tip: when contributing to GitHub repositories like ours, the best strategy is that you create a new git branch based on your main branch, for each issue you are working on, and put your contributions for that specific issue in there. That makes sure that all your contributions are isolated on a specific branch and your main branch remains untouched (as it should be because this one should be in sync with our main). This also enables you to contribute to multiple issues at without code from issue A affecting code from issue B.

Currently you cannot do this because you already made a PR with changes on your main branch. But keep this in mind for the future.

milanholemans avatar Mar 21 '23 09:03 milanholemans

is also enables you to contribute to multiple issues at without

this is exactly tip i needed !! @milanholemans i had it somewhere back in my mind, but never tried :) thanks.

ValerasNarbutas avatar Mar 21 '23 09:03 ValerasNarbutas

Hey @ValerasNarbutas, just checking in. How is everything going regarding this issue?

Jwaegebaert avatar Nov 23 '23 13:11 Jwaegebaert

Resetting due to lack of response

waldekmastykarz avatar Jan 14 '24 08:01 waldekmastykarz

Can I work on this?

MathijsVerbeeck avatar Feb 14 '24 10:02 MathijsVerbeeck

@MathijsVerbeeck note that this might interfere with #5644

milanholemans avatar Feb 14 '24 11:02 milanholemans

I'll wait for the merge of Nandeeps' PR and work on this afterwards.

MathijsVerbeeck avatar Feb 14 '24 11:02 MathijsVerbeeck