Forum Discussion

AlejandroGombao's avatar
AlejandroGombao
Copper Contributor
Aug 06, 2024

Report all existing Sharing Links in all SharePoints

Hello,

We are planning a complete cross-tenant migration, and need to somehow get a list of all existing Sharing Links in all of our (over 150) SharePoint sites, and which people (emails) are those links shared with, to replicate those accesses post-migration.

I have been investigating a lot about this but have been unable to find any solution for this case, even though it sounds like a pretty normal thing to me.

I know there are reports from SharePoint admin that will show the last 30-days activity in creation of Sharing Links (which is not enough).

 

There also is the possibility to manually access the Site Usage of any site and run a report that will be stored in a folder inside the same site. The report generated this way is almost what we need. Only problem is that the Sharing Links created to "SharePoint Groups" instead of specific users contain no info about what group was it actually shared with.

I know I could manually go to the file and check the groups that have access to it in "Manage Access" section, but that is exactly the thing we want to avoid by automating this.

 

I also had a PnP script shared with me by a Microsoft Engineer that have been throwing many different errors after every of the several attempts to make it work and fixing it, normally related to: "command was found in the module 'SharePointPnPPowerShellOnline', but the module could not be loaded due to the following error: [Could not load type 'Microsoft.SharePoint.Client.ClientAuthenticationMode' from assembly 'Microsoft.SharePoint.Client.Runtime"

Some other times the error was referring to access denied.

 

I have been trying to find a way to do this for over a month now and I'm starting to despair a bit.
Anyone here knows a way to get this information?


Thank you in advance,
Alejandro.

2 Replies

  • luisbernardi's avatar
    luisbernardi
    Copper Contributor

    Hi, not sure if it is too late. Joined the community today.
    I think a way could be by iteration of all the groups that have the name starting with sharing link, then get the members of those groups which should allow you to get their emails.
    The only challenge maybe that the sharing link groups tend to be created with the setting to only allow to be queried by the members, so if you are trying to get the members you may get an "access denied" error. The workaround could be adding your account or the service account you are using to run your scripts as members of all those sharing links groups . Alternatively, (and probably cleaner) you could change the settings that allows everyone to get members of each sharing links group. This may help.

Resources