How to get a list of shared links in a SharePoint Online document library? Any PowerShell or other way?

frob 4,216 Reputation points
2022-09-02T20:41:59.363+00:00

Hi there
How to get a list of shared links in a SharePoint Online document library? Any PowerShell or other way?
(Shared links when we click on the ellipsis next to a folder/file, and click Share, and type the emails of users)
Thanks.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,793 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,396 questions
{count} votes

Accepted answer
  1. Haoyan Xue_MSFT 20,431 Reputation points Microsoft Vendor
    2022-09-05T07:12:31.833+00:00

    Hi @frob
    Please run the following PnP powershell code:
    237705-shared.txt
    The running result is shown in the following figure:
    237658-16.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    4 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Dillon Silzer 54,746 Reputation points
    2022-09-04T03:10:52.583+00:00

    Hi @frob

    You can try using Microsoft Purview:

    How to identify resources shared with external users

    https://learn.microsoft.com/en-us/microsoft-365/compliance/use-sharing-auditing?view=o365-worldwide#how-to-identify-resources-shared-with-external-users

    ------------------------------------------------------

    If this is helpful please accept answer.