Skip to content
Back to overview Illustration: guest badges at the entrance, expired ones are removed, open shares are closed
Microsoft 365 Entra ID External collaboration

Cleaning up guest accounts and external sharing in Microsoft 365

By , Security & Cloud Operations 9 min read

Key takeaways

  • Guest accounts appear as a side effect of Teams invitations, SharePoint sharing and groups. Since Microsoft moved external sharing in SharePoint and OneDrive to Entra B2B in 2026, every share with a specific external person creates a guest account.
  • The first step is an inventory: all guests with last sign-in, invitation status and group memberships.
  • Access reviews remove inactive guests on an ongoing basis; the “inactive users only” option requires Microsoft Entra ID Governance and guest billing through an Azure subscription.
  • “Anyone” links in SharePoint and OneDrive should be switched off, or at least given an expiry date.
  • Teams has two separate mechanisms: external access (chat with other organisations) and guest access (membership in a team). They are controlled separately.

A project ends, a partner changes, the agency was let go long ago. The guest accounts stay. Each one is a way into your tenant, often with access to Teams channels, SharePoint libraries and groups. For management this is a question of confidentiality and accountability: who can see quotes, design data or HR documents today, and who decided that? This article shows how to take stock, clean up and keep things tidy with a fixed process.

Why do guest accounts grow unnoticed?

Guest accounts (user type “Guest” in Microsoft Entra ID, technically B2B collaboration users) are not only created by administrators. By default, every user in the organisation can invite guests, and so can existing guests. Team owners add external people to teams, and staff share files from OneDrive.

There is also a change in SharePoint and OneDrive. Between May and July 2026, Microsoft enabled the Microsoft Entra B2B integration for new external sharing in commercial tenants, and it can no longer be switched off. From October 2026, Microsoft is retiring SharePoint’s own one-time passcode method. Every share with a specific external person therefore creates a guest account in Entra ID. From a security point of view this is welcome, because these identities are now visible and controllable in one place. It also means the number of guests will rise and you need a process for their lifecycle.

How do you find all guest accounts and spot inactive ones?

In the Microsoft Entra admin center, go to Entra ID > Users and filter by User type = Guest. Under Manage view > Edit columns, add the Last interactive sign-in time column and filter by date, for example older than 90 days. Guests who never accepted their invitation show the status “Pending acceptance”; with these, it is often unclear whether the address was right in the first place.

To produce a list via Microsoft Graph, the signInActivity property returns the last sign-in; this requires Microsoft Entra ID P1:

GET https://graph.microsoft.com/v1.0/users?$filter=userType eq 'Guest'&$select=displayName,mail,createdDateTime,signInActivity

With Microsoft Entra ID Governance there is also a dedicated report under ID Governance > Dashboard > Guest access governance > View inactive guests. It groups guests by days since last sign-in, with a default threshold of 90 days, and separates guests who have never signed in.

How do you remove inactive guests permanently?

A one-off deletion helps for a month. What works long term is access reviews: recurring checks in which guests confirm they still need access, or a responsible person decides.

Microsoft describes two patterns that complement each other well:

  1. Remove inactive guests automatically. A dynamic group contains all enabled guest accounts. An access review scoped to “Guest users only” with the option “Inactive users (on tenant level) only” checks quarterly for guests who have not signed in for the defined number of days. If reviewers do not respond, access is removed, and the action for denied guests is “Block user from signing in for 30 days, then remove user from the tenant”.
  2. Guests confirm their own access. A multi-stage review first asks guests whether they still need access, then passes the approvals to the group owner for a final decision.

On licensing: access reviews require at least Microsoft Entra ID P2. Reviews scoped only to inactive users, and the inactive guest report, are part of Microsoft Entra ID Governance. For guests, Microsoft bills these governance features per monthly active user through a linked Azure subscription; a guest is only billed in a month in which they were actually included in such a review. Microsoft has enforced the subscription link since January 2026: without it, new inactive-guest reviews cannot be created. For organisations with few guests the cost is usually modest, but it should be clarified up front.

Without these licences, the manual route remains: export the list, ask the responsible person for each guest, disable accounts first and delete them after a grace period. Deleted guests can be restored for 30 days.

Which settings limit new guest accounts?

The key settings are under Entra ID > External Identities > External collaboration settings:

  • Guest user access: The most restrictive level limits guests to their own directory objects, so they cannot see member lists of other groups or other guests.
  • Guest invite settings: Instead of “anyone can invite”, allow only administrators and users with the Guest Inviter role. Giving that role to team leads who take responsibility for their guests works well in practice.
  • Collaboration restrictions: A deny list excludes specific domains; an allow list admits only known partners. Microsoft points out that an overly narrow allow list pushes people back to sending files as email attachments.

For partners who use Microsoft Entra ID themselves, cross-tenant access settings additionally control which users and applications are allowed in each direction and whether you trust the partner’s MFA. A Conditional Access policy should require MFA for all guests.

How do you control sharing in SharePoint, OneDrive and Teams?

SharePoint and OneDrive

In the SharePoint admin center under Policies > Sharing, you set the sharing level. From most open to most closed:

LevelMeaningAssessment
AnyoneLinks without sign-in that can be forwarded freelyOnly with expiry and view-only; better switched off
New and existing guestsExternal people sign in or verify with a codeRecommended for most organisations
Existing guestsOnly guests already in the directoryNot recommended by Microsoft, as guests are created in many ways
Only people in your organizationNo external sharingFor sites with sensitive data

OneDrive can be set to the same level as SharePoint or more restrictive, not more open. Individual sites can be restricted further, for example the HR site set to “Only people in your organization”.

Under More external sharing settings there are two important options. Guest access to a site or OneDrive will expire automatically after this many days removes guests’ access after the defined period; the person who shared can extend it. Allow only users in specific security groups to share externally limits external sharing to named groups. If you cannot switch off “Anyone” links, set an expiry date for them and allow view access only.

One caveat: if you turn off external sharing for the organisation and later turn it back on, guests regain their access. To get rid of old shares, remove them at site level first.

Teams: external access and guest access

Teams distinguishes two things that are often confused:

  • External access (federation) allows chat, calls and meetings with people in other organisations without creating an account in your tenant. By default it is open to all domains; you can restrict it to a list of allowed domains.
  • Guest access adds an external person to a team as a guest, with access to channels and files. It is also on by default and follows the Entra settings; Teams can be more restrictive than Entra ID, but not more open.

For most organisations, external access limited to known partner domains and guest access for project teams with a named owner is a sensible middle ground.

What does a process that keeps working look like?

  1. Every guest has an internal owner. Entra ID provides the “Sponsors” field for this, and whoever sends the invitation is added automatically. According to Microsoft, guests created through a SharePoint share currently do not receive a sponsor, so add one manually. No owner, no invitation.
  2. Invitations through one defined route only. The Guest Inviter role for team leads, or an access package with an expiry date, as described in our article on access packages in Entra ID.
  3. Quarterly review of inactive guests, automated or based on an exported list.
  4. Expiry for sharing in SharePoint and OneDrive, with “Anyone” links switched off or time-limited.
  5. Evidence: file the review results and the list of guests with their owners once a quarter. This is exactly what auditors ask about access management under ISO 27001 and TISAX.

Next step

Guest access and sharing settings are a fixed part of our Microsoft 365 hardening. If you would like to see where you stand first, our fixed-price Security Assessment shows how many guests your tenant has, which of them are inactive and which shares are open.

Book an introductory call

Frequently asked questions

Does a guest account need a licence?

For normal collaboration in Teams and SharePoint, a guest does not need its own Microsoft 365 licence. Costs arise for certain Microsoft Entra ID Governance features, which are billed per monthly active guest, such as reviews scoped to inactive guests.

What happens to files when I delete a guest?

The files remain unchanged in SharePoint or OneDrive; the guest simply loses access. An accidentally deleted guest account can be restored for 30 days; after that a new invitation is needed.

For most organisations, yes. Such a link can be forwarded to anyone, and you cannot tell who accessed the content. If one area genuinely needs anonymous links, for example for press material, restrict them to that site, to view access and to a validity of a few days.

Is disabling the guest account enough?

For the moment, yes: a disabled account cannot sign in. In the long run the account should be deleted so that it is not reactivated by mistake and the directory stays manageable.

Let's talk about your IT security

In the introductory call (30 minutes, no obligation) we clarify:

  • where your company stands today and what concerns you most
  • which next step makes sense for your organisation
  • what effort and price range to expect
Bastian Wenske

Bastian Wenske

Founder & Managing Director

Heidelberger Straße 15
12059 Berlin
Germany

Prefer to reach out directly? Send us an email at [email protected].