Graph sharedWithMe deprecated featured image: sharedWithMe goes quiet this month

If you have a script, an app or a Power Automate flow that calls /me/drive/sharedWithMe or /me/drive/recent, it’s on borrowed time. Microsoft Learn says both stay in a degraded state until November 2026 and then stop returning data. This post covers what’s going, how I find old calls in my own scripts, and what I’m moving them to.

What is being retired

Four Microsoft Graph endpoints stop returning data after November 2026:

EndpointWhat it returnedLearn page
/me/drive/sharedWithMeFiles and folders shared with the userdrive: sharedWithMe
/me/drive/recentFiles the user opened or changed recentlydrive: recent
/me/insights/sharedDocuments shared with the userList shared
/me/insights/usedDocuments the user viewed or changedList used

The deprecation itself isn’t new. The Graph changelog recorded recent and sharedWithMe as deprecated in November 2025. What’s new is the cut-off.

The word “degraded” matters. Before an endpoint stops completely, it can return fewer items than the user sees in OneDrive. If a report’s numbers dropped in the last few months and nobody touched the script, this could be why.

Finding old calls in your scripts

I keep my scripts in one folder, so a text search finds them quickly. My function Find-MttDeprecatedGraphEndpoint does that search. Download it from my GitHub, load it and run it:

. .\Find-MttDeprecatedGraphEndpoint.ps1
Find-MttDeprecatedGraphEndpoint -Path C:\Scripts | Export-Csv .\GraphEndpoints.csv -NoTypeInformation -Encoding UTF8

The .json files cover exported Power Automate flows and SPFx config. Flows that call Graph through an HTTP action don’t live in a folder, so check those in the flow itself.

I ran it against my own C:\Workfolder folder, where I keep my blog scripts, leaving out the folder with this post’s own scripts, which contain the endpoint names on purpose:

PS> Find-MttDeprecatedGraphEndpoint -Path C:\Workfolder -Exclude 'C:\Workfolder\MSTechTalk Content\Nov-2026-posts'
PS>

Nothing returned is the result you want. If you get rows, each one shows the file, the line number, the retired endpoints on that line and the line itself. Group-Object Endpoint gives you a count per endpoint.

What to use instead

I haven’t found a documented one-to-one replacement on Microsoft Learn. The Microsoft Q&A threads on this end the same way: use the Microsoft Search API for file discovery, and accept that it behaves differently. That’s what I’m doing.

The Search API returns the files the signed-in user can access, trimmed by permissions. It doesn’t know what someone shared with you or what you opened last. You build that from a query and a sort order. For a recent files view, I query documents and sort by last modified date.

My function Get-MttRecentDocument runs this query with Microsoft Graph PowerShell (Microsoft.Graph.Authentication module) and delegated Files.Read.All and Sites.Read.All. Sign in, load it and run it:

Connect-MgGraph -Scopes Files.Read.All, Sites.Read.All
. .\Get-MttRecentDocument.ps1
Get-MttRecentDocument -Top 25 | Export-Csv .\RecentDocuments.csv -NoTypeInformation -Encoding UTF8

-Top goes past the 500-result page limit by paging, and -Query narrows the search with KQL, for example filetype:xlsx.

Run it as an ordinary user, not as admin, if you want to see what a user really sees. An admin account gets results from every site it can open.

Here are the first five of the 25 results on my demo tenant, signed in as my admin account, with Select-Object Name, LastModified, LastModifiedBy:

Name                                               LastModified          LastModifiedBy
----                                               ------------          --------------
Benefits Tracker Template - Small Projects.xlsx    11/14/2026 3:33:27 PM Olivia Bennett
Benefits Tracker Template - Major Projects.xlsx    11/14/2026 3:33:27 PM Olivia Bennett
Final Account Template - Major Projects.xlsx       11/14/2026 3:33:27 PM Olivia Bennett
Benefits Tracker Template.xlsx                     11/14/2026 3:33:27 PM Olivia Bennett
Final Account Template - Small Projects.xlsx       11/14/2026 3:33:27 PM Olivia Bennett

Two things I noticed. The sort on lastModifiedDateTime worked on v1.0. And the WAM warning is real: if you run this from VS Code’s terminal, the sign-in window can open behind it, and the script looks stuck. All 25 results were Excel templates from the MST-PMO Templates library, because those were the files changed most recently on the sites my account can open.

Both functions and a README are on my GitHub: Graph-SharedWithMe-Retirement.

What you lose: items shared with you from another tenant (sharedWithMe had ?allowexternal=true for that), and the detail of who shared an item and when. If your app needs those, add your voice to the feedback item linked from the Q&A threads, because there’s nothing documented to move to yet.

Try it yourself

  1. Download both functions from GitHub. Find-MttDeprecatedGraphEndpoint needs no module; Get-MttRecentDocument needs Microsoft.Graph.Authentication.
  2. Run Find-MttDeprecatedGraphEndpoint on the folders where you keep scripts and exported flows, and fix every file it lists.
  3. Sign in with Connect-MgGraph as an ordinary user, run Get-MttRecentDocument, and compare the list with that user’s Recent view in OneDrive.
  4. Try -Query with filetype:docx or a site path: to see how far KQL gets you towards the view your app needs.

Adnan Amin is a Microsoft MVP for Microsoft 365 (since 2015) and a Senior Microsoft Consultant. He writes practical guides and PowerShell scripts for SharePoint, OneDrive, Teams and Copilot admins.

Leave a Reply

Your email address will not be published. Required fields are marked *