
Hi @Anuar
Is it possible too share files (textfiles/pdf's) through Teams with anonymous users? If yes, how do we go about accomplishing this?
Yes, you can!
To complete it, you should make sure the SharingCapability is ExternalUserAndGuestSharing. We can find the SharingCapability by logging onto Sharepoint Online with PowerShell, as an admin user with the appropriate permissions:
Connect-SPOService
Get-SPOSite -Identity siteurl | select SharingCapability
If this file is upload to Teams Site, you could get the link by navigating to the team’s general channel and the files tab, then choose open in SharePoint. A browser window will open with a long URL, where you will need to extract everything including what comes immediately after /sites/. The rest of the URL can safely be ignored. The URL should look like this: https://tenantname.sharepoint.com/sites/teamname. Let’s store the URL in a variable for later use:
$siteurl = https://tenantname.sharepoint.com/sites/teamname
Then all we need to do is change the SharingCapability property:
Set-SPOSite -Identity $siteurl -SharingCapability ExternalUserAndGuestSharing
Now you can choose a folder or document whithin the team’s SharePoint site and share with Anyone. In this setting you would most likely also want to disallow editing. Once you hit Apply you can copy the link and distribute it as you choose.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.