GitHub Icon Image
GitHub

Remove the Teamify link on Group sites

Summary

If your governance dictate that Group owners should not be able to change a Group site to a Teams site, you can remove the promote link with this script.

Example Screenshot

Remove the Teamify link on Group sites

  • PnP PowerShell
  • PnP PowerShell without enabling custom scripting
  • CLI for Microsoft 365
    #connect to the site using one of the many options available
    $conn = Connect-PnPOnline -Url $url -interactive -ReturnConnection  -ErrorAction Stop  
        
    #enable custom script on site   
    Set-PnPSite -Identity $url -NoScriptSite $false -Connection $conn
    #Update the Property bag key to remove Teams Prompt
    Set-PnPPropertyBagValue -Key "TeamifyHidden" -Value "True" -Connection $conn
    #Disable custom script on site or leave it enabled, it will automatically be disabled after 24 hours
    Set-PnPSite -Identity $url -NoScriptSite $true -Connection $conn

    #alternatively use Set-PnPTeamifyPromptHidden
    Set-PnPTeamifyPromptHidden -Connection $conn

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?

    #connect to the site using one of the many options available
    $conn = Connect-PnPOnline -Url $url -interactive -ReturnConnection  -ErrorAction Stop          
    Set-PnPTeamifyPromptHidden -Connection $conn

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?

    # m365 login --authType browser --url $url
    m365 login --authType browser

    # Enable custom script on the site
    m365 spo site classic set --url $url --noScriptSite false
   
    # Update the Property bag key to remove Teams Prompt
    m365 spo propertybag set --webUrl $url --key "TeamifyHidden" --value "False"

    # Disable custom script on the site
    m365 spo site classic set --url $url --noScriptSite true

Check out the CLI for Microsoft 365 to learn more at: https://aka.ms/cli-m365

Important changes coming to the way you login into CLI for Microsoft 365 (effective 9th September 2024) see Changes in PnP Management Shell registration in Microsoft 365

Contributors

Author(s)
Kasper Larsen
Reshmee Auckloo
Valeras Narbutas

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Back to top Script Samples
Generated by DocFX with Material UI