SharePoint and OneDrive sharing and lifecycle
Design site ownership and sharing limits, manage OneDrive for leavers, and restore deleted content.
By Invicly Tech, , in Microsoft Entra & Microsoft 365 Administration. About 11 minutes to read.
In short
SharePoint holds team and project files in sites, and OneDrive holds each person's own files. Admins set the outer sharing limit for the whole organisation, then sites can be equal or stricter, never looser. Admins also decide what happens to a leaver's OneDrive and know how to bring back deleted files and sites.
Think of it like this: The organisation sharing setting is the front gate; each site can lock its own door tighter but cannot leave it wider than the gate.
Explained simply
SharePoint stores files for teams and projects in places called sites. OneDrive is each person's own file space, and it is built on SharePoint too. When you create a team in Teams, a SharePoint site is created behind it to hold the team's files.
Admins decide how widely files can be shared. At the top is an organisation setting: maybe only staff, maybe guests you already know, maybe anyone with a link. Each site can be the same or stricter. It can never be looser than the organisation setting.
A sharing link is how one file reaches someone. The safest kind works only for specific people you name. Anyone links work for whoever has the link, like a spare key under the mat, so many organisations turn them off or make them expire.
When someone leaves, their OneDrive does not vanish at once. By default it is kept for 30 days and their manager is given access, so important files can be moved. After that it is deleted, unless a retention policy says otherwise.
Deleted files go to a recycle bin and can be brought back for up to 93 days. A whole library or OneDrive can be rolled back to an earlier time within the last 30 days, which helps after mass deletion or ransomware.
Press Play on a diagram to walk through it one step at a time.
- 1Organisation (SharePoint)
Anyone, new and existing guests, existing guests, or only your org
- 2Organisation (OneDrive)
Same or stricter than SharePoint
- 3Site
Same or stricter than the organisation
- 4Link
Specific people, people in your org, or anyone
- 1User deleted
Account removed in Entra or the admin center
- 2Manager gets access
Manager, or a secondary owner, is emailed a link
- 3Retention period
Default 30 days, adjustable by admins
- 4Moved to deleted sites
Restorable for a limited time
- 5Permanently removed
Unless a retention policy still holds it
- A few files
- Site or OneDrive recycle bin
- Second-stage recycle bin
- Many files or ransomware
- Files Restore
- Restore this library or Restore your OneDrive
- A whole site
- SharePoint admin center > Deleted sites
- Restore-SPODeletedSite
- A group-connected site
- Restore the Microsoft 365 group within 30 days
- A leaver's OneDrive
- Manager access during retention
- Restore the deleted user or site in time
In depth
Organisation and site sharing limits
In the SharePoint admin center, Policies > Sharing sets the organisation level for SharePoint and for OneDrive. The options, from widest to narrowest, are Anyone, New and existing guests, Existing guests, and Only people in your organization. OneDrive can be the same or stricter than SharePoint. Each site can then be set the same or stricter than the organisation.
Use the levels deliberately. A common pattern is New and existing guests for the organisation, then Only people in your organization for HR and finance sites. You can also limit sharing to allowed domains, stop guests resharing, and set expiry on Anyone links. In PowerShell, Set-SPOTenant sets the organisation level and Set-SPOSite sets one site.
- Anyone: ExternalUserAndGuestSharing
- New and existing guests: ExternalUserSharingOnly
- Existing guests: ExistingExternalUserSharingOnly
- Only your org: Disabled
Links scoped to named recipients
There are three main link types. Specific people links work only for the named people, who must sign in or prove who they are with a one-time code. People in your organization links work for any signed-in colleague. Anyone links work for whoever holds the link, without signing in.
Set the default link type to Specific people so the safe choice is the easy choice. With PowerShell that is Set-SPOTenant -DefaultSharingLinkType Direct. If Anyone links are allowed, set an expiry, such as 30 days, and consider view-only. Remember that a specific-people link forwarded to someone else will not work for them, which is the point. Sharing reports and the site's Manage access pane show what links exist.
- Only named recipients
- Recipient must verify identity
- Safe default
- Forwarding does not grant access
- Any signed-in staff member
- Not for guests
- Handy for internal notices
- Can spread widely
- No sign-in needed
- Works for whoever has it
- Set an expiry date
- Often disabled
Group-connected sites and ownership
When someone creates a team in Teams, or a Microsoft 365 group, a team site is created and connected to the group. The group's owners become site owners and its members become site members. Manage membership in the group, not in the site's permissions page, or the two will drift apart.
Give every site at least two owners so it never becomes orphaned when one person leaves. Deleting the group also deletes the site; the group can be restored for 30 days, which brings the site back. Communication sites and classic team sites are not group-connected, so their permissions are managed in SharePoint groups instead. Site owners decide who gets in; admins set the outer rules.
OneDrive for leavers and restoring content
When a user account is deleted, their OneDrive is kept for the retention period, 30 days by default, and their manager gets an email with access. Admins can change the period, from 30 days up to 10 years, in the SharePoint admin center or with Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod. Microsoft has changed how long unlicensed OneDrive accounts can be kept free, so check current terms before keeping many.
For restores, deleted files go to the site recycle bin, then a second-stage bin, for 93 days in total. Files Restore rolls a OneDrive or library back to any point in the last 30 days. Deleted sites go to Deleted sites and can be restored with Restore-SPODeletedSite within 93 days. A retention policy in Microsoft Purview can keep content longer, but it is not a backup you can restore with one click.
- Default leaver retention: 30 days
- Recycle bins: 93 days total
- Files Restore: last 30 days
- Deleted sites: 93 days
- Retention is not backup
Learn it in 5 short steps
About 35m each. Track them with a timer in your plan.
- 1Set organisation sharing limits~35m
- 2Use specific-people links~35m
- 3Understand group-connected sites~35m
- 4Retain a leaver's OneDrive~35m
- 5Restore files and sites~35m
Key points
- Set the organisation sharing limit first; sites and OneDrive cannot exceed it.
- Make specific-people links the default so files go only to named recipients.
- A group-connected site's owners and members come from its Microsoft 365 group.
- Copy what a leaver's manager needs before the OneDrive retention period ends.
- Recycle bins keep deleted items for 93 days; Files Restore can roll back 30 days.
Key terms
Tap a card to flip it. 0/5 known
Examples
Connect-SPOService -Url https://contoso-admin.sharepoint.com
# Allow sharing only with guests already in the directory
Set-SPOTenant -SharingCapability ExistingExternalUserSharingOnly
# Default new links to specific people
Set-SPOTenant -DefaultSharingLinkType Direct
# Keep leavers' OneDrive for 180 days
Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod 180
# List deleted sites that can still be restored
Get-SPODeletedSiteUses the SharePoint Online Management Shell against a lab tenant.
Offboarding Ben's OneDrive
Ben leaves Contoso on Friday. Prerequisites: SharePoint Administrator role and Ben's manager set in Entra. Step 1: block Ben's sign-in and revoke sessions. Step 2: tell his manager, Carla, what to expect. Step 3: delete Ben's account. Carla receives an email with a link to Ben's OneDrive. Step 4: Carla moves project files into the team site within the 30-day window. Step 5: evidence: the files appear in the team site and the OneDrive shows in Deleted sites after the period ends. Rollback within 30 days: restore Ben's account.
Locking down the HR site
The organisation allows new and existing guests, but HR documents must stay internal. Step 1: in the SharePoint admin center, open the HR site and set sharing to Only people in your organization. Step 2: check it has two owners. Step 3: test as an HR member by trying to share a file with a guest address: the option is refused. Step 4: confirm the default link type is Specific people. Rollback: set the site back to the previous level.
Connect-SPOService -Url https://contoso-admin.sharepoint.com
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/HR -SharingCapability Disabled
Get-SPOSite -Identity https://contoso.sharepoint.com/sites/HR |
Select-Object Url, SharingCapability, OwnerQuick reference
- Site sharing can be equal to or stricter than the organisation, never looser
- OneDrive sharing can be equal to or stricter than SharePoint
- Default link: Set-SPOTenant -DefaultSharingLinkType Direct (specific people)
- Manage group-connected site access through the Microsoft 365 group
- Leaver OneDrive: 30 days by default, manager gets access
- Recycle bins keep items 93 days; Files Restore covers the last 30 days
- Restore a deleted site: Restore-SPODeletedSite within 93 days
- Give every site at least two owners
Common mistakes
- Loosening a site's sharing and then wondering why it is still blocked: the organisation limit wins.
- Removing a user from a group-connected site in site permissions instead of from the Microsoft 365 group.
- Assuming the OneDrive retention period is a backup; after it ends the data is gone unless a retention policy holds it.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
In a trial tenant, check the organisation sharing level for SharePoint and OneDrive and the default link type. Write them down.
- Exercise 2medium
Delete a test file and a test folder from a site, restore them from the recycle bin, then delete a test site and restore it.
- Exercise 3hard
Write a leaver runbook for OneDrive that covers manager access, a longer retention period for executives, licence removal timing and what happens if no manager is set.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Is OneDrive just SharePoint?
- Under the surface, yes. Each OneDrive is a personal SharePoint site, which is why many settings and restore tools are shared.
- Can I turn off Anyone links completely?
- Yes. Set the organisation level to New and existing guests or narrower, and Anyone links can no longer be created.
- Does the recycle bin count as a backup?
- No. It protects against recent mistakes. For long-term protection you need retention policies or a separate backup service.
- What if a site has no owners left?
- An admin can add a new owner in the SharePoint admin center. Requiring two owners for every site prevents this.