Company News

How to enable Guest Folder and File Sharing for Office 365 Group Files

June 1, 2017


For SharePoint Online Site Collections, enabling anonymous (“anyone” or “guest”) links for a site collection is really straightforward in the “manage site collections” section of Office 365 Admin.

You know, this guy…

However, if you have created a new, fancy/fangled Office 365 Group to leverage Teams and other goodies inside your organization, you will have by now noticed that the Site Collections that power the underlying storage and plumbing are not available to be managed.  We need another way to make this possible.

So What

First off, a few things to clarify here:

  1. We are not talking about private or public groups. Private/Public in Office 365 Groups determine whether the groups is “discoverable” within your organization. In other words, can someone, inside our company find the group and request to join, or not.  It has nothing to do with externa guest file sharing.
  2. We are not talking about inviting external users to an Office 365 Group. While that is recently possible, the requirement/desire here is that:
    1. The organization can use the group internally as it is intended, complete with teams
    2. However, within the group, they want to share “some” files or folders with external guests/contributors rather than moving the files to another place, to collaborate

Now What

It’s not clear yet whether Microsoft plans to ever give us this ability on the surface (a few button clicks), though I suspect with demand/pressure, it is coming.  There is lots of chatter in this uservoice, and it indicates “boom, it is done” but it isn’t clear what exactly is done: https://office365.uservoice.com/forums/286611-office-365-groups/suggestions/16365496-allow-anonymous-link-sharing-for-files-and-folders


You may have found this blog post if:

  1. You get “Anyone” when you try to share files within the SharePoint site for an Office 365 Group and guest sharing isn’t enabled
  2. You see the message “Your organization is preventing you from selecting this option”

Frustrating. And not super clear how to deal with it (yet).

So for now, we have PowerShell…

  1. Connect to SharePoint Online using SharePoint Online Management Powershell (get it here: https://www.microsoft.com/en-ca/download/details.aspx?id=35588)


$usercredential = Get-Credential -username $adminUPN -Message "type password"

Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

  1. Identify and connect to the desired Site Collection


  1. Enable External User and Guest Sharing on that chosen Site Collection
set-sposite -identity $Siteurl -sharingcapability ExternalUserAndGuestSharing

 That's it.  Now check your work (refresh the page/site collection).


And what a visitor sees (visiting your shared folder)

Once shared, a folder looks like any other SharePoint site that has external sharing on, for the guest contributor.

15 Responses

  1. Glen says:

    Thanks, this is exactly what i was after. Appreciate the post.

  2. Joe says:

    Hi Sean,

    I’ve tried this on a collections that was an originally an Office365 Group but was later tied to a Microsoft Team. I get the following error: (domain name removed for privacy)

    set-sposite : Value cannot be null.
    Parameter name: password
    At line:1 char:1
    + set-sposite -identity https://contoso.sharepoint.com/sites/
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Set-SPOSite], ArgumentNullException
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Online.SharePoint.PowerShell.SetSite

    It appears it won’t let me change this setting where a password is not required to access the collection. Is this only possible with pure Office365 Groups and not with Team collections?


  3. Joe says:

    Never mind, you can delete my comment. My Powershell connections to O365 timed out and I hadn’t realized it logged me off. I haven’t had enough coffee today…

  4. Thank you! Thank you! A thousand times thank you!

    Office 365 tried valiantly, but to no avail. Your easy fix did the trick!


  5. Mike says:

    Thanks so much for this, I’ve been tearing my little remaining hair out trying to figure out how to share just a few subfolders to an external customer without giving them the keys to our entire group site. Perfect solution.

  6. Christian Andersson says:

    Love it!


  7. Edward says:

    You Legend!! So glad you posted this Gold nugget for other mortals who are at the mercy of Giant providers rushing out half solutions!

  8. Andrew says:

    Thank you for posting this guide, Very helpful and solved the issue for me.

  9. Jeroen says:

    Nice! But what if I would like to see this behaviour on every newly created Office 365 Group?
    I think it should be possible using the SET-SPOTenate command but I haven’t figured it out yet.

    At this moment I’m running a PowerShell-script every night that checks for new Groups and adds the ‘set-sposite -identity $Siteurl -sharingcapability ExternalUserAndGuestSharing’ command to all files older then one day.

    For all of you that need this script (credits to the Original poster of this script, it’s not mine):

    $lastXdays = 1 (# Groups created on or after today – $lastXdays will be updated)

    $Groups = Get-UnifiedGroup -ResultSize unlimited | Where-Object {$_.SharePointSiteUrl -ne $null} | Where-Object {$_.WhenCreated -ge ((Get-Date).AddDays(-$lastXdays))}
    foreach($siteURL in $Groups.SharePointSiteUrl) { set-sposite -identity $siteURL -SharingCapability ExternalUserAndGuestSharing }

    The first time I’ve changed the @lastdays to 1000 and runned the script. This way every file older then 1000 days is modified so it took a while.

    If anyone knows how to acomplish this in a more elegant way: please reply to this post 🙂

  10. Ian Caldwell says:

    Excellent! Worked exactly as expected, probably saved me countless hours of hair-pulling to hit a brick wall 🙂

  11. DC in TX says:

    Thank you! You are my new personal hero.

  12. Ciprian says:

    Thanks dude, worked like a charm!

  13. OxCrab says:

    This setting is now available in the new (preview) sharepoint admin portal (https://xxxxxxx-admin.sharepoint.com). Select the individual site, and adjust “Sharing Status” as required.

  14. Steve says:

    Thank you for posting this! I was able to share with external users.

  15. Mark Galloway says:

    Thanks for the post.

    However, the option for sharing with anyone is still deactivated and I am still getting the message that the organization is preventing this option. Does anyone have anything else to add that I can check or try?

    Thanks again.

Leave a Reply

Sean Wallbridge

Sean Wallbridge-square-150x150

Beer Me!

Subscribe via Email


Powered by...

itgroove Corporate Profile
Connect With Us