Skip to content

Instantly share code, notes, and snippets.

@aflyen
Created June 20, 2022 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aflyen/d7d99c94d8e5f83d078b48d942caa11c to your computer and use it in GitHub Desktop.
Save aflyen/d7d99c94d8e5f83d078b48d942caa11c to your computer and use it in GitHub Desktop.
Use PnP.PowerShell to set a property bag value to hide the Teamify dialog in modern SharePoint sites. This requires the "DenyAndAddCustomizePages" setting on the site to be temporary disabled. A more recommended approach can be found here: https://gist.github.com/aflyen/0bcf8ce02ca52cbc5ab5ab8b2a48ca8f
# Connect to the site
Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/Project101"
# Temporary disable setting to allow access to the property bag
Set-PnPSite -DenyAndAddCustomizePages $false
# Set value in property bag
Set-PnPPropertyBagValue -Key "TeamifyHidden" -Value "TRUE"
# Re-enable setting to keep recommended security level
Set-PnPSite -DenyAndAddCustomizePages $true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment