30-second answer
Connect-PnPOnline -Url https://contoso-admin.sharepoint.com -Interactive -ClientId $clientId
$tenant = Get-PnPTenant
$tenant.FileAnonymousLinkType # None | View | Edit | ViewUpload
$tenant.FolderAnonymousLinkType # None | View | Edit | ViewUploadThe product default is Edit. An unread setting is more likely to be the
permissive value than the restrictive one, so an absent reading is not good
news.
What this proves
What somebody holding an Anyone link may do with what it opens, separately for files and for folders. Whoever holds the link was never asked to sign in, so whatever they do afterwards is not attributable to a person.
What it does not prove
- Whether Anyone links are used. This describes what they permit, not how many exist or who has one.
- That the content is private. Setting the permission to
Viewnarrows what an anonymous holder can do. It does not make the file unreachable, and a link that was forwarded is still a link that was forwarded. - What an individual site permits. A site can be more restrictive than the organisation. This is the organisation setting.
PowerShell
$clientId = '00000000-0000-0000-0000-000000000000'
Connect-PnPOnline -Url https://contoso-admin.sharepoint.com -Interactive -ClientId $clientId
$tenant = Get-PnPTenant
[pscustomobject]@{
Capability = $tenant.SharingCapability
OnFiles = $tenant.FileAnonymousLinkType
OnFolders = $tenant.FolderAnonymousLinkType
}The capability comes along because it decides whether the other two matter at all: where Anyone links are not permitted, there is no anonymous permission to read.
Example output
Capability OnFiles OnFolders
---------- ------- ---------
ExternalUserAndGuestSharing Edit EditAnonymousLinkType returns one of None, View, Edit or ViewUpload.
ViewUpload exists for folders and is what the Request Files feature needs.
Explanation
Two settings, and they are not the same question as whether unauthenticated
sharing is allowed. That question is answered by SharingCapability. This one
asks what an unauthenticated holder may do once they are in.
Microsoft states the default and the alternative in the same section: by default, Anyone links for a file allow people to edit the file, and Anyone links for a folder allow people to edit, view and upload. Both can be changed to view only, independently. Then comes the recommendation: an organisation that wants to allow unauthenticated sharing but is "concerned about unauthenticated people modifying your organization's content" should consider setting file permissions to View and folder permissions to View or View and upload.
The condition attached to that recommendation is the ordinary case, which is what makes it usable as guidance rather than as a preference.
The same page notes what following it does not cost: Specific people links still grant editing, and those require the recipient to authenticate, which makes what they did attributable afterwards.
Files and folders are deliberately different questions. Microsoft names
two acceptable folder values, View and ViewUpload, because the second is
what Request Files needs. A check that compared folders against a single value
would report organisations that are following the guidance.
Production considerations
- This is a read. Nothing here writes. The tenant setting is changed with a different cmdlet, which is not on this page.
- Observed on a tenant, not only against the module: the call returns these properties and the values fall in the enum above.
- View only is still unauthenticated read. This narrows what an anonymous holder can do; it is not a substitute for deciding what may be shared anonymously in the first place.
- A tenant that forbids Anyone links has nothing to report here, and that is an answer rather than a gap. Treating an empty reading as a pass would be inferring success from an absence.
Related governance rules
SPO-SHARE-004 reads the file permission and fails when an Anyone link grants
anything other than View. Where the capability forbids Anyone links, it
reports not applicable: the rule has nothing to say, and saying unknown
would be a question asked of an organisation it does not apply to.
The folder permission is deliberately not evaluated, for the reason above: Microsoft names two acceptable values, and a rule comparing against one would fail organisations that are doing what they were told.
References
- Best practices for sharing files and folders with unauthenticated users
- Manage sharing settings for SharePoint and OneDrive in Microsoft 365
- Get-PnPTenant
Found something wrong? Suggest a correction. The article source is not public; the engine it cites is.
What this answer underwrites
The engine reads these Microsoft operations to collect evidence, so what is established here is what those collectors rest on.
tenant-sharingwhat the organisation permits, which every site inherits by default