Skip to content

Bug report: m365 aad o365group user list --groupId returns the wrong membership information if a user is member and owner #2374

@plamber

Description

@plamber

Description

When using the m365 aad o365group user list --groupId you are receiving a misleading list of memberships when dealing with the Microsoft 365 Group if a user is in the members and owners list.

When interacting with Teams an owner is part of the owners and members list at the same time while a member is just part of the memberslist. Calling the alias of m365 aad o365group in the context of teams returns the correct information by hiding these details. On the other hand, when dealing with the Microsoft 365 Group interface I shouldn't follow this logic.

Steps to reproduce

  • Create a Microsoft 365 Group
  • Add a user as owner and member
  • Run m365 aad o365group user list --groupId
  • You will see that the user is returned with "userType": "Owner" only

Expected result

When using the m365 aad o365group user list command I am expecting to get back two entries and not one. On the other hand, when using the teams command I am expecting the behavior we are seeing today.

My suggestion is to separate the m365 aad o365group user list command and m365 teams user list command. Keep the current logic for the teams command but change the logic in the o365group command.

Actual result

User is listed only once

Environment

Latest CLI version

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions