How to List Users with Access to SharePoint Sharing Links via PowerShell
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.

- 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.
Ensure you have the SharePoint Online Management Shell installed and possess the necessary SharePoint administrator privileges before attempting to run auditing scripts.
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.
Open your web browser and go to the official Microsoft Q&A website.
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.
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.

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. Download and Install WPS Office: Get the free installer from the official WPS website and complete the quick installation process.
- 2. Open Your Document: Launch WPS Office and open the document, spreadsheet, or presentation you want to collaborate on.
- 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.

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.




