Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > How to Disable the Flow button in SharePoint Online
September 19
How to Disable the Flow button in SharePoint Online

Now, now, I know what you’re thinking, “This is a terrible idea! Why would any want to disable Flow?? What’s Flow ever done to them anyway?” I’m right there with you, honest I am, but a customer asked me how to do this and I can’t imagine they’re the only ones trying to do it. So while I’m a big fan of Flow and think everyone should enjoy it, in the unlikely event your organization doesn’t want to, here’s how to disable it.

When things are in their default state, the Ribbon, or Toolbar in a Modern List or Document Library in Office 365 shows an easy to use link to wire up a Flow to the library. It looks like this:

SNAGHTML206e612

Very cute, very innocent, but regardless, some folks don’t want it there. Even if the user hitting the list or library isn’t licensed to use Flow, it’s there. This is a per site collection setting, and nowhere in the site or site collection settings is there a place to shut it off. I turned on the Bat Signal, and PowerShell answered my call. Sort of…

The official Microsoft SharePoint Online cmdlets have a cmdlets, Set-SPOSite and it has a parameter, –DisableFlows. Are you thinking what I’m thinking? Of course you are. And it does what we want, kind of. Here’s how the whole solution looks:

Connect-SPOService -Url https://flowhater-admin.sharepoint.com

$val = [Microsoft.Online.SharePoint.TenantAdministration.FlowsPolicy]::Disabled
Set-SPOSite -Identity
https://flowhater.sharepoint.com/sites/Me2Hub -DisableFlows $val

You have to do the funny business with $val because the –DisableFlows parameter doesn’t accept a boolean, like a civilized parameter does, it requires its value to be in the form of a Microsoft.Online.SharePoint.TenantAdministration.FlowsPolicy object, whatever that is. So that’s what it gets.

Now when we go to our Document Library it looks like this:

SNAGHTML20d5a7a

Sad, I know. When you come to your senses and want to reenable Flow, here’s how you do it:

$val = [Microsoft.Online.SharePoint.TenantAdministration.FlowsPolicy]::NotDisabled
Set-SPOSite -Identity
https://flowhater.sharepoint.com/sites/Me2Hub -DisableFlows $val

And now is all right in the world.

Unless you have the fancy Site Collections that are using Groups in the background. Then you get the “womp womp” sound from Set-SPOSite. Okay, it really says, “Set-SPOSite : https://flowhater.sharepoint.com/sites/SPODemo2-Test2 is a Groups site collection.” but we all know what it really means. A less motivated man would have given up at this point. He would have taken this as a sign from the universe that one should not be disabling Flows, it’s just unnatural. Not this man. (In reality, not this man’s customer). So I went to Plan B, the PnP PowerShell, and it did not disappoint. The PnP’s version of the Set-Site cmdlet works with Group Site Collections and doesn’t require any weird casting voodoo. Here’s how it looks:

Connect-PnPOnline -Url https://flowhater.sharepoint.com/sites/SPODemo2-Test2 -Credentials 'SteffenAdmin'

Set-PnPSite -DisableFlows:$true

Here’s how you right that wrong:

Set-PnPSite -DisableFlows:$false

That’s much easier, and works on all site collections.

There you have it. I hope you never have to use it. Smile

tk

ShortURL: https://www.toddklindt.com/PoshDisableFlowButton

Comments

thanks

the way flow is delivered ou of the box, it enables any user to automatically sync business data with his personal on-drive and email. this should be a major concern for most people , but i don't think they realize it.

flows should be disabled by default until someone configures the environment to prevent data loss!
 on 9/22/2018 10:55 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 Please Support my Sponsors