There is no Microsoft Graph API that pulls list of site users. With PnP.PowerShell it’d be easy: Get-PnPUser. Here is the Graph site resource type – there is nothing like that. For group-based sites (e.g. Teams, Viva Engage communities – you get get group members via MS Graph API, but that’s different. So, what do we do to get all SharePoint site users with MS Graph API?
The answer is very simple. Every SharePoint site has a hidden (system) list called User Information List. And that is exactly what you need. So, you’d get list “User Information List” and get all it’s items via graph API:
- Use MS Graph Get List API to get “User Information List” list
- Use MS Graph Get List Items API to get all list item – which would be site users 🙂
P.S. using Get-PnPUser against sites with large population could fail with HttpClient.Timeout error, so in such cases we’d use the same approach – get items from User Information List via Get-PnPListItem -List “User Information List” -PageSize 1000. See details in the “Use Get-PnPUser correctly for large sites” KBA.