How to Review External User and Guest Access in SharePoint Online
Review external SharePoint access through guest accounts, groups, direct permissions and sharing links. Some access, especially through Anyone links, cannot be tied to a named person.

To review external access, check both guest accounts and the SharePoint permissions that can admit external users. Guest lists alone miss some group memberships, direct permissions and sharing links. Anyone links are a separate risk because you cannot identify everyone holding the link.
External access in SharePoint Online can arrive through several doors. Guests in the directory, guests in Microsoft 365 groups, guests inside nested security groups, older "Specific people" links to addresses with no guest account, and "Anyone" links with no identity at all. A review that only lists guest users in Entra ID sees one door.
This guide enumerates the doors, shows how to inspect each one, and ends with a review procedure you can repeat. Microsoft's overview of external sharing explains the sharing models and settings it refers to.
The ways an external person gets in
- B2B guest in Entra ID. A user object with
userTypeofGuest, typically created by an invitation. SharePoint and OneDrive use Entra B2B integration, so new sharing in commercial tenants creates a guest. - Guest membership in a Microsoft 365 group. A guest added to a group gets the group's connected site permissions (usually Members, so Edit) and Teams access.
- Guest membership in an Entra ID security group, including nested groups, that is itself in a SharePoint group. The site owner may never have seen the guest.
- Direct role assignment of a guest on a site, library, folder or item.
- "Specific people" sharing links on an item. These admit named people, who must sign in as that person. In commercial tenants, new sharing creates an Entra guest account.
- "Anyone" links. No identity. Anyone holding the URL has the link's permission (View or Edit) until it expires or is removed.
- Site collection administrator set to a guest, which is rare but catastrophic.
In the report, keep four kinds apart: Entra ID guest accounts; external users granted SharePoint access; specific-people sharing links; and Anyone links, where the identity of whoever used the link may not be known. A guest inventory alone cannot prove that every external person who may use a sharing link has been identified.
Each door has its own inventory method.
Inventory 1: Guest users in the directory
Connect-MgGraph -Scopes "User.Read.All","AuditLog.Read.All"
Get-MgUser -Filter "userType eq 'Guest'" -All `
-Property id,displayName,mail,userPrincipalName,createdDateTime,externalUserState,signInActivity |
Select-Object displayName, mail, createdDateTime, externalUserState,
@{n="LastSignIn"; e={ $_.SignInActivity.LastSignInDateTime }}
externalUserState of PendingAcceptance means the invitation was never redeemed. LastSignIn far in the past is a candidate for removal. This list is the population; it does not tell you what any of them can reach.
Inventory 2: Where each guest has access
Two complementary approaches.
From the site side, the SharePoint Online Management Shell lists external users per site:
Connect-SPOService -Url https://contoso-admin.sharepoint.com
Get-SPOSite -Limit All | ForEach-Object {
$site = $_
$position = 0
do {
$page = @(Get-SPOExternalUser -SiteUrl $site.Url -Position $position -PageSize 50 -ErrorAction SilentlyContinue)
$page | Select-Object @{n="Site"; e={ $site.Url }}, DisplayName, Email, AcceptedAs, WhenCreated, InvitedBy
$position += $page.Count
} while ($page.Count -eq 50)
}
The cmdlet returns at most 50 people per call, so the loop pages with -Position. This catches guests that SharePoint knows about on each site, but it reports the guest, not the path.
From the identity side, transitiveMemberOf for a guest shows every group they are in, directly or through nesting:
GET https://graph.microsoft.com/v1.0/users/{guest id}/transitiveMemberOf?$select=id,displayName,groupTypes,securityEnabled
Intersect that with the Entra ID and Microsoft 365 groups that hold role assignments on your sensitive sites and you have the group-based paths. Groups with Unified in groupTypes are Microsoft 365 groups; securityEnabled without Unified is a security group.
Inventory 3: Sharing links
Sharing links are principals on the item. Each is a hidden SharePoint group named SharingLinks.<item guid>.<kind>.<link guid>, where the kind is OrganizationView, OrganizationEdit, AnonymousView, AnonymousEdit, Flexible (specific people) and similar. To find them, enumerate items with unique permissions and look at their role assignments:
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/Finance -Interactive -ClientId $ClientId
$items = Get-PnPListItem -List "Documents" -PageSize 2000 -Fields "FileRef","HasUniqueRoleAssignments" |
Where-Object { $_["HasUniqueRoleAssignments"] }
foreach ($item in $items) {
$ras = Get-PnPProperty -ClientObject $item -Property RoleAssignments
foreach ($ra in $ras) {
$m = Get-PnPProperty -ClientObject $ra -Property Member
if ($m.Title -like "SharingLinks.*") {
[pscustomobject]@{ Item = $item["FileRef"]; Link = $m.Title; Users = (Get-PnPGroupMember -Group $m.Title | ForEach-Object Email) -join ";" }
}
}
}
Microsoft Graph also exposes links per drive item, which is convenient for a single library:
GET https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/permissions
Permissions with a link property are sharing links; link.scope of anonymous is an Anyone link, organization is company-wide, users is specific people. grantedToIdentitiesV2 lists the specific-people audience. Note that Graph shows links per item, so a library-wide inventory means walking the drive.
Anyone links deserve their own line in every report: they have no identity, and Microsoft notes that access through them can't be audited to a person. Microsoft logs AnonymousLinkUsed when an Anyone link is used and FileAccessed when an external user uses a specific-people link (sharing auditing), but an Anyone link event does not establish the identity of an unauthenticated person who opened it.
Inventory 4: The settings that decide what is possible
External access is bounded by tenant and site settings. Record them alongside the inventory; a review is meaningless without the policy it is measured against.
Get-SPOTenant | Select-Object SharingCapability, DefaultSharingLinkType, DefaultLinkPermission,
RequireAnonymousLinksExpireInDays, FileAnonymousLinkType, FolderAnonymousLinkType,
ExternalUserExpirationRequired, ExternalUserExpireInDays,
SharingDomainRestrictionMode, SharingAllowedDomainList, SharingBlockedDomainList
Get-SPOSite -Identity https://contoso.sharepoint.com/sites/Finance |
Select-Object SharingCapability, DefaultSharingLinkType, DefaultLinkPermission, DisableCompanyWideSharingLinks
SharingCapability values from most to least open: ExternalUserAndGuestSharing (Anyone links allowed), ExternalUserSharingOnly (authenticated guests only), ExistingExternalUserSharingOnly, Disabled. A site cannot be more permissive than the tenant. ExternalUserExpirationRequired with ExternalUserExpireInDays makes guest access on sites and OneDrive expire unless renewed, which is one of the few settings that reduces review work over time.
A repeatable review procedure
- Freeze the policy. Export tenant and per-site sharing settings. Note the date.
- List the population. Guest users with state, creation date and last sign-in.
- Map the paths per sensitive site. On each inheritance boundary, expand every role assignment transitively and flag
userType eq 'Guest'identities, recording the full route. - List the links. Every
SharingLinks.*group and every Graph permission with alink, with kind, audience and expiry. - Decide. For each guest path and link: keep (with owner and justification), expire, or remove. Anyone links on anything sensitive are almost always "remove."
- Act and verify. Remove access, then re-run steps 3 and 4 to confirm. Remember propagation delay before declaring a guest cut off.
- Record who admitted each path. Pull the audit events (
AddedToGroup,Add member to group.,SharingInvitationCreated,SecureLinkCreated,AddedToSecureLink,AnonymousLinkCreated; see Microsoft's list of audited activities) so the next review starts with attribution.
For step 7 the retention clock applies: see How Long Does Microsoft 365 Keep SharePoint Audit History?.
Access reviews and expiration
Entra access reviews can help review selected group memberships, and guest expiration in SharePoint removes guests from sites after a set number of days. SharePoint access may also come through direct permissions, nested membership and sharing links, so review the complete access routes as well.
FAQ
- A specific-people link went to an address that is not a guest in Entra ID. How?
- Older links could use SharePoint's own one-time passcode, which created no guest account. Microsoft scheduled its retirement for commercial tenants starting in October 2026. Recipients without a matching guest account then get access denied.
- Does removing a guest from Entra ID remove their SharePoint access?
- Deleting the guest user revokes sign-in, and their direct and group-based paths stop working. Their entries may still appear in site user lists until cleaned up, and Anyone links they used remain valid for anyone else.
- Can I find Anyone links tenant-wide?
- Start with SharePoint Advanced Management's organization-wide permission report. It shows the number of Anyone links on each reported site. To investigate individual links and what they allow, use SharePoint's permission tools or Microsoft Graph. A site-level count is not a complete list of everyone who can use a link.
Related reading
Related guides
All guides
Microsoft 365 Security9 min readbeginner
Does Microsoft 365 Copilot Respect SharePoint Permissions? What Can It See?
Copilot follows SharePoint permissions, so it only shows each person what they can already open. Learn what that includes, when a sharing link counts, how to find content open to everyone, and how to limit what Copilot finds while you fix it.

SharePoint Permissions8 min readbeginner
How to See Who Has Access to a SharePoint Site, Folder, or File
Use SharePoint's own screens to see who has access to a site, a folder or a single file, and learn what each screen leaves out, from the people inside groups to site admins and sharing links.

Compliance & Audit10 min readintermediate
How to Export SharePoint Online Permissions for an Audit
Export SharePoint permissions with Microsoft's reports or a tested PowerShell script, see what each export leaves out, and save a dated baseline you can compare later.