-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Get-PnPFileSharingLink and Get-PnPFolderSharingLink does not return anything for shared files/folders #3912
Comments
@AndersRask , the Get-PnPFileSharingLink and Get-PnPFolderSharingLink return info only when there is an actual link, the format is different, if you go to the "Manage Access" , there will be a links, otherwise it does not return anything if there are no links, although it might have created unique permissions for the file or folder. I started looking into it only 2 weeks ago and not sure whether behaviour changed over the past. I am pondering on the best way to report sharing information. Most probably we need another cmdlet for Get-PnPFileSharingInfo using endpoing /_api/web/lists/getbytitle('listname')/items(itemid)/GetSharingInformation$select=permissionsInformation&$Expand=permissionsInformation @gautamdsheth: please share your views. |
MS changed the way how files are shared, MC706173. Now when you invite a user to access the file. This gets direct permissions instead of creating a shared link. |
Thanks @Barbarur : I don't use sharing that much except and was re exploring after a couple of years to understand functionality and clearly I missed the update MC706173. The update makes sense though confusing as unique permissions are still set on folders, files or items without the sharing link. |
@AndersRask : I have updated my blog post https://reshmeeauckloo.com/posts/powershell-get-sharing-links-sharepoint/ to include a comparison using CSOM, the PnP cmdlets and REST endpoint. However CSOM only returns all sharing information unfortunately. |
@reshmee011 it's even more weird actually. The new sharing is when you use click on "Share" and then "Invite". But if you use the "Copy link" function, the classic sharing link is still created. |
@Barbarur , thanks for explaining the new sharing versus classic sharing. Wonder if it is a feature MS needs to work on to stop the sharing links being created. |
Hi @Barbarur It works fine when I explicitly use the link. Microsoft managed to get people even more confused than before with that update :) this ticket can be closed |
I was getting access denied when trying to fetch sharing links for a customer. I made a feature request on their repo, but I think this would be a good thing to add to the documentation! |
Reporting an Issue or Missing Feature
Get-PnPFileSharingLink
and
Get-PnPFolderSharingLink
does not return anything even when files/folders are shared
Expected behavior
When calling the cmdlets
Get-PnPFileShareingLink
and
Get-PnPFolderSharingLink
I expected to get sharing link kinds for the files/folders (including LinkKind for review sharing according to feature #2949 )
When I call the [Microsoft.SharePoint.Client.ObjectSharingInformation]::GetObjectSharingInformation(..) I get the 5 standard sharing links.
What am I doing wrong?
Actual behavior
Nothing is returned when calling the cmdlets. If I call the cmdlets with invalid data, they return "Item not found" (expected)
Steps to reproduce behavior
(nothing is returned even though several files in the doclib are shared)
If I instead call the static method GetObjectSharingInformation(..) i get the link (and all other data left out for this example for brevity)
Example output that shows links are shared:
for the folder version, it is the same. If i use the above code, a link is shared
get-pnplistitem -List Documents | ? { $_["FSObjType"] -eq 1 } | % { Get-PnPFolderSharingLink -Folder $_["FileRef"]}
(nothing is returned even though folders are shared)
What is the version of the Cmdlet module you are running?
2.4.44 nightly PnP.PowerShell
PSVersion 7.4.2
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: