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?

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 23,620 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.