Looking for a way to cycle through a fileCollection and check weather or not the file has been shared interally, externally or has unique permissions. I want to create a app to audit some of my O365 sites collections that have external sharing turned on.
I don’t see anything in the role assignments, definition bindings or user objects that indicates if an item was shared externally or which external users have access to it.
What I ended up doing was getting the users under each role assignment (full control, contribute, view, etc) then matching those with a list of external users provided by the Microsoft SharePoint Online powershell cmdlet (Get-SPOExternalUser). That cmdlet only provides external users at a site collection level but at least I know which users are external and can then match their permissions at the site or item level.
Let me know if you find a better way or want more details on how I did it.