Forum Discussion
OneDrive Internal Sharing for Non Owners
There needs to be a way of setting this at an organizational level. I am able to turn off sharing for non-owners via powershell, however it requires me to create a script to connect to each person's OneDrive, and it leaves the "Allow access requests" unchecked.
Goal: Require any re-sharing to be approved by the owner for the entire organization.
Have you tried toggling the ODBAccessRequests setting? Used together with the ODBMembersCanShare one, it should allow you to achieve that. https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/set-spotenant?view=sharepoint-ps
Or you can always toggle it per-SC via:
Set-SPOSite -Identity https://contoso.sharepoint.com -DisableSharingForNonOwners
- Jeremy HamiltonBrass Contributor
I have attempted this and it is partially successful. I am able to globally disable sharing, however, when you set the $ODBAccessRequests="On", it breaks because there is now a new option to set the owner or an alternate email address. The script doesn't select any option for you at all. It just blanks everything out.
I guess you can set just ODBMembersCanShare then, ignore ODBAccessRequests.