Find all expired sharing links in SharePoint using PowerShell

Roy_Jaze 40 Reputation points
2024-07-16T12:31:42.8066667+00:00

How can I use PowerShell to find all expired anonymously shared links in SharePoint? I found this script (shared (1).txt) in this thread and modified it to (File.txt). However, it only fetches links with the access type of "can view and can edit," not links with the access type of "can review and can't download." Can someone help me modify the script to include all expired links regardless of their access type?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,249 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,800 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,306 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 15,320 Reputation points Microsoft Vendor
    2024-07-17T02:32:29.9333333+00:00

    Hi @Roy_Jaze,

    Thank you for posting in this community.

    Unfortunately, we don't have a way to distinguish between can`` review and can't download and can view types of share links. According to the official documentation, we can only determine whether the current share link is Can Edit or Can review type sharing link.

    User's image

    Reference: SharingLinkInfo Class

    We are always looking for ways to improve SharePoint, and your feedback and suggestions are very valuable.

    We suggest that you can make suggestions on this SharePoint Feedback portal for further optimization of SharingLinkInfo properties. Your contribution will be highly appreciated.


    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful