Enumerate Entra ID users and groups as a Guest
mainThe Get-DCEntraIDUsersAndGroupsAsGuest script is a proof-of-concept tool that allows a guest user to enumerate users and security groups/teams in a target tenant, even when guest access restrictions are enabled.
How it works: It uses a 'friend of a friend' approach, starting from known User Principal Names (UPNs) and performing nested queries (up to 5 iterations) to discover the directory structure. It works if the tenant's guest restrictions are set to 'most inclusive' or the default 'limited access' settings, but NOT if set to 'most restrictive'.
Parameters:
-TenantId(Required): The ID of the target tenant.-AccountId(Required): Your UPN in your home tenant.-InterestingUsers(Required): One or more UPNs of users in the target tenant to serve as starting points for the search.
Get-DCEntraIDUsersAndGroupsAsGuest -TenantId '00000000-0000-0000-0000-000000000000' -AccountId 'user@example.com' -InterestingUsers 'customer1@customer.com', 'customer2@customer.com'