microsoftgraph / msgraph-sdk-serviceissues

Tracks service issues for follow up.
5 stars 0 forks source link

Get-MgUserMemberOf -Filter not working #128

Closed lesca closed 1 year ago

lesca commented 1 year ago

This Get-MgUserMemberOf command not working with -Filter parameter

$groups = Get-MgUserMemberOf -UserId $aadUser.Id -Filter "startswith(displayName, 'a')"

The error message:

Get-MgUserMemberOf : The specified filter to the reference property query is currently not supported.
At line:1 char:9
+         $groups = Get-MgUserMemberOf -UserId $aaduser.Id -Filter "sta ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ UserId = 4037...ndProperty =  }:<>f__AnonymousType2`9) [Get-MgUserMemberOf_List1], RestException`1
    + FullyQualifiedErrorId : Request_UnsupportedQuery,Microsoft.Graph.PowerShell.Cmdlets.GetMgUserMemberOf_List1

However, this should be supported as described in doc:

GET https://graph.microsoft.com/v1.0/users/{id}/memberOf/microsoft.graph.group?$count=true&$orderby=displayName&$filter=startswith(displayName, 'a')
ConsistencyLevel: eventual

Update: SDK Version

Version              Name                                Repository           Description
-------              ----                                ----------           -----------
1.11.0               Microsoft.Graph                     PSGallery            Microsoft Graph PowerShell module
timayabi2020 commented 1 year ago

@lesca Thanks for identifying this issue. This is indeed a service issue, since the document indicates that there is support for the filtering feature, but the response is different from the expectation. Kindly open a ticket here if you have a subscription, otherwise you can ask a question so that the workload owners can respond.