Skip to content
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

get-mgTeamMember does not retrun all members or owners of a Team #2830

Closed
MarkF26 opened this issue Jul 5, 2024 · 3 comments
Closed

get-mgTeamMember does not retrun all members or owners of a Team #2830

MarkF26 opened this issue Jul 5, 2024 · 3 comments

Comments

@MarkF26
Copy link

MarkF26 commented Jul 5, 2024

Describe the bug

The Get-mgTeamMember does not return all the member/owners of a Team. Results of the Team admin center are more accurate.

Expected behavior

results of the get-MGTEamMember should match with the Teams admin center, as verified by get-PnPTeamsUser

How to reproduce

steps to produce the problem:

  1. Use get-MGTeamMember -TeamID $TeamID | select displayname, roles | ft
  2. Use the Teams Admin Center and show the same team memberships
    The Admin center GUI shows more members than the results returned in step 1.
    The results in GUI are verified to be accurate because a call to get-PnPTeamsUser returns the exact same results in step 2.
    Any attempt to update a member missing in step 1, but found in step 2 using update-MGTeamMember (for example change from member to owner) results in an error message: Could not find member. Status: 404 (NotFound) ErrorCode: NotFound

SDK Version

2.19.0

Latest version known to work for scenario above?

not tried

Known Workarounds

none

Debug output

Click to expand log ```

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PATCH

Absolute Uri:
https://graph.microsoft.com/v1.0/teams/<hidden_for_security_reasons>/members/<ConversationID_hidden_for_security_reasons>

Headers:
FeatureFlag                   : 00000043
Cache-Control                 : no-store, no-cache
User-Agent                    : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.17763; en-US),PowerShell/2024.2.2
Accept-Encoding               : gzip
SdkVersion                    : graph-powershell/2.19.0
client-request-id             : b760d5ca-86ea-472e-9338-d71d8a4f471a

Body:
{
  "@odata.type": "#microsoft.graph.aadUserConversationMember",
  "roles": [
    "owner"
  ]<
}


DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : 5d717b51-7bbc-4799-9cbd-10e2070850a7
client-request-id             : b760d5ca-86ea-472e-9338-d71d8a4f471a
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"4","ScaleUnit":"004","RoleInstance":"MW2PEPF0
000E01A"}}
Date                          : Fri, 05 Jul 2024 22:54:32 GMT

Body:
{
  "error": {
    "code": "NotFound",
    "message": "Could not find member.",
    "innerError": {
      "code": "ItemNotFound",
      "message": "Could not find member.",
      "details": [],
      "date": "2024-07-05T22:54:32",
      "request-id": "5d717b51-7bbc-4799-9cbd-10e2070850a7",
      "client-request-id": "b760d5ca-86ea-472e-9338-d71d8a4f471a"
    }
  }
}

Could not find member.  Status: 404 (NotFound) ErrorCode: NotFound Date: 2024-07-05T20:13:05  Headers: Vary                      
     | : Accept-Encoding Strict-Transport-Security     : max-age=31536000 request-id                    :
     | 8b1c567f-5898-4631-8da5-7acc433e2bd3 client-request-id             : 75897531-32d2-4dd4-affa-bba405a60005 x-ms-ags-diagnostic    
     | : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"4","ScaleUnit":"003","RoleInstance":"CO1PEPF00004A98"}} Date       
     | : Fri, 05 Jul 2024 20:13:05 GMT

Configuration

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Other information

No response

@MarkF26 MarkF26 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 5, 2024
@MarkF26 MarkF26 changed the title get-MGTeamMember does not retrun all members or owners of a Team get-mgTeamMember does not retrun all members or owners of a Team Jul 5, 2024
@timayabi2020 timayabi2020 added Status: Needs Investigation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jul 9, 2024
@timayabi2020
Copy link
Contributor

@MarkF26 it seems you are combining two issues here. One for GET and the other one for PATCH requests.

  1. For the GET request, i.e. GET-MgTeamMember, have you tried supplying the -All parameter? Also please add a -Debug parameter and verify on the response body whether the @odata.count tallies with the number of items you have in the GUI.
image
  1. I was not able to reproduce the issue on the update request. Please ensure that you are supplying the correct conversation member id. It should be among the list of Ids returned by Get-MgTeamMember.
image

@MarkF26
Copy link
Author

MarkF26 commented Aug 16, 2024

Sorry for the delay. I'll rerun the script with debug and other requetsed info, and reply back.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Aug 16, 2024
@MarkF26
Copy link
Author

MarkF26 commented Aug 27, 2024

here are some debugging output for a failed command:
image

response:
image

the team actually has the user as a member when inquiried from Team admin center

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants