We are performing an audit on user permissions throughout our tenant, since we have been discovering that some permissions have been interfering with each other and because we have had turnover, making these issues more and more problematic over time. We started working on a very small site and its libraries the other day, just to watch it all work on a small example, should we start changing permissions. It went very well, and we were able to remove all unique permissions entirely, which included all links that had been generated to files and folders.
However, even though the links have been disabled, it did not actually REMOVE those disabled links from the files and folders, which we all expected it to do. We found this out when users who had permissions went to their resources, copied the links to those resources, and tried to share them with each other; they were the same links and of course were no longer valid! Only when we went into each resource individually, as the need arose and "removed" the links that had been generated, did it generate new ones that actually worked.
This leads me to the reason I am here. I figure there must be a way, possibly with PowerShell, to remove all links to resources and folders within sites and libraries at once and force them to generate new ones. It's okay if each library or site must be specified separately, though I would prefer if content was within a sub-site or a library, that I could specify for all of them at once.
The big issue, however, is that I cannot find any reference as to how to accomplish any part of this.
If you have any ideas, I would love to hear them!
Thanks, in advance!
(cross-posted, without success, to super user SharePoint Online - Managing Disabled Links)