Forum Discussion
TheHailender
Jan 15, 2020Brass Contributor
Get document by SharingDocId with Powershell
Hi, I found the hidden list "Sharing Links" on a SharePoint site. It seems that all shared links are stored in this list. Now my question: How do I get to the shared document using this link...
DavidShvartsman
Oct 17, 2022Copper Contributor
SharingDocId is Document UniqueId of the Document/folder in the document libraries
$SharingDocId = "<SharingDocId>"
$Ctx = Get-PnPContext
$file = $ctx.Web.GetFileById($SharingDocId)
$ctx.Load($file)
$ctx.ExecuteQuery()