'How to get all guest users count in M365 groups with Microsoft graph api
I tried to get all guest users count in all M365 groups in single Microsoft graph api call I have written below query for that.
https://graph.microsoft.com/v1.0/users?$expand=memberOf($filter=groupTypes/any(c:c eq 'unified'))&$filter=userType eq 'Guest'&$Count=true
it looks like nested query inside memberof is not filtering group. Any help or suggestions will be highly appreciated. Thanks in advance
Solution 1:[1]
To review all guest users assigned to all Microsoft 365 groups , please use the below query, refer this DOC.
"instanceEnumerationScope": {
"query": "/groups?$filter=(groupTypes/any(c:c eq 'Unified'))",
"queryType": "MicrosoftGraph"
},
"scope": {
"@odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "./members/microsoft.graph.user/?$filter=(userType eq 'Guest')",
"queryType": "MicrosoftGraph"
}
Please also check the group search limitations for guest users in organizations, refer this DOC.
Hope this Helps.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mehtab Siddique |