The best option for you is to use something like this script that queries all of the guest users and their group membership:
To query the guest users, you can use:
Get-AzureADUser -All $true -Filter "UserType -eq 'Guest'"
OR
Get-AzureADUser -Filter "UserType eq 'Guest'" | select DisplayName, Mail
To export the users to a CSV file you can use:
Get-AzureADUser -Filter "UserType eq 'Guest'" | select DisplayName, Mail | Export-Csv guests.csv -NoTypeInformation
Then you can use Get-AzureADUserMembership for individual users and run a ForEach loop to get it for everyone.
The most straightforward thing to do would be to follow the blog post, Export Office 365 Guest User Report with their Membership, and use the accompanying GetUserReport.ps1 script.
Hope this helps!
https://o365reports.com/2020/11/12/export-office-365-guest-user-report-with-their-membership/