Permission & Access Issues

How to List Users with Access to SharePoint Sharing Links via PowerShell

Algirdas JasaitisAlgirdas Jasaitis Nov 2, 2026 870 views

Question details

The user needs to enumerate all users who have access to SharePoint or OneDrive sharing links, specifically capturing external guests and recipients using one-time verification codes.

How to List Users with Access to a SharePoint Sharing Link Using PowerShell
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Auditing document access to identify external users and their corresponding email addresses for specific shared content.
Observed behavior
Standard Azure AD directories do not always list recipients who authenticate via one-time verification codes as conventional guest accounts, requiring advanced PowerShell scripts to extract this data.
Before you start

Ensure you have the SharePoint Online Management Shell installed and possess the necessary SharePoint administrator privileges before attempting to run auditing scripts.

Solution 1Recommended

Find PowerShell Scripts in the Microsoft Q&A Community

Because enumerating external sharing links and one-time passcode users requires complex custom scripting, querying the official Microsoft community is the most effective approach.

SharePoint and OneDrive sharing links often include guest users who authenticate with one-time verification codes rather than standard Azure AD accounts. Because these users do not appear as conventional guest accounts, standard administration center reports may be insufficient.

To generate a comprehensive list containing document URLs and external user emails, you will need a specialized PowerShell script. The Microsoft Q&A community hosts a wealth of PowerShell expertise specifically for SharePoint Online.

1
Navigate to Microsoft Q&A

Open your web browser and go to the official Microsoft Q&A website.

2
Search for Existing Scripts

Use the search bar to look for discussions titled 'What PowerShell can list all SharePoint Online content shared with external users, with URL and the external users email?' or similar queries.

3
Post Your Specific Requirement

If you cannot find a script that perfectly matches your environment, post a new question under the 'SharePoint Online' tag detailing your need to list one-time verification code recipients.

Find PowerShell Scripts in the Microsoft Q&A Community
Community Assistance: When posting in the Microsoft Q&A community, specify whether you need to audit a single site collection or your entire SharePoint Online tenant to get the most accurate script.
Free Microsoft Office alternative

Looking for a Simpler Way to Manage Document Sharing?

While auditing SharePoint sharing links requires advanced PowerShell scripting and deep administrative knowledge, WPS Office provides a straightforward, lightweight, and completely free alternative for your daily document collaboration. Enjoy a familiar interface and seamless compatibility with Microsoft Office formats without the complex management overhead.

  1. 1. Download and Install WPS Office: Get the free installer from the official WPS website and complete the quick installation process.
  2. 2. Open Your Document: Launch WPS Office and open the document, spreadsheet, or presentation you want to collaborate on.
  3. 3. Share with Ease: Click the 'Share' button in the top right corner to generate a link and easily manage who can view or edit your file.
Easily share documents and manage user access permissions through an intuitive interface.Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight application that uses minimal system resources.Free to download and use for seamless team collaboration.
microsoft office alternative - wps office

Frequently Asked Questions

Why do some external users not appear in Azure AD?

Users who access SharePoint or OneDrive links by authenticating with a one-time verification code are often not added as conventional guest accounts in your Azure Active Directory, making them harder to track with standard tools.

Can I list shared files natively in the SharePoint Admin Center?

While the SharePoint Admin Center provides basic usage reports and site sharing settings, generating a comprehensive list of specific document URLs and external email addresses typically requires custom PowerShell scripting.

Where can I find reliable PowerShell scripts for SharePoint Online?

The Microsoft Q&A community is the recommended platform for finding administrative scripts. By browsing the 'SharePoint Online' tag, you can access scripts shared by Microsoft experts and other administrators.