Skip to content

Groups filter for property "hasMembersWithLicenseErrors" not working #2967

@joergrenn

Description

@joergrenn

Describe the bug

I am trying to get all groups with license assignment errors in the tenant:
Get-MgGroup -CountVariable CountVar -Filter "hasMembersWithLicenseErrors eq true" -Property "id,displayName" -ConsistencyLevel eventual

This is even an example in MS learn: https://learn.microsoft.com/de-de/graph/api/group-list?view=graph-rest-1.0&tabs=powershell#example-2-get-a-filtered-list-of-groups-including-the-count-of-returned-objects

However the response is unsupported filter clause:

Get-MgGroup_List: Unsupported or invalid query filter clause specified for property 'hasMembersWithLicenseErrors' of resource 'Group'.

Expected behavior

Get all groups in the tenant with license assignment errors

How to reproduce

Execute
Get-MgGroup -CountVariable CountVar -Filter "hasMembersWithLicenseErrors eq true" -Property "id,displayName" -ConsistencyLevel eventual

SDK Version

2.23.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
OS                             Darwin 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:52 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions