There apparently is now a way to hide the Sync button for all SharePoint libraries in your tenant.
https://learn.microsoft.com/en-us/sharepoint/sharepoint-sync
Set-SPOTenant -HideSyncButtonOnTeamSite $true
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello team,
We need to block sync SharePoint and Onedrive in user devices.
I disabled in SPO admin center the option to "show the Sync button on the OneDrive website", however it icon still appears.
I think the workaround for this requirement is to enable "Allow syncing only from computers joined to specific domains" and put as domain controller GUID any fictional value, this will block the sync for OneDrive, but, It will also block sync for SPO?
what do you think about this workaround?
There apparently is now a way to hide the Sync button for all SharePoint libraries in your tenant.
https://learn.microsoft.com/en-us/sharepoint/sharepoint-sync
Set-SPOTenant -HideSyncButtonOnTeamSite $true
Hi @Sergio Londono,
Thank you for posting in this community.
The method described in your question is about disabling the Sync button in OneDrive for Business.
If you want to disable the Sync button on SharePoint Online, please refer to the following:
Please note that SharePoint does not have a way to directly hide the Sync button on an entire tenant, only for a document library, a site and all sites on a site collection.
1.Disable sync at the library level (Make sure you have the full permission level for this file library):
2.Disable sync at the Site level (Make sure you are the admin for this site):
3.Remove Sync Button in All Sites of the Site Collection:
Please use SharePoint Online Management Shell to run following PowerShell:
Function Disable-SPOSyncButton([String]$SiteURL)
{
Try{
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Credentials
#Get the Web and Sub Sites
$Web = $Ctx.Web
$Ctx.Load($Web)
$Ctx.Load($Web.Webs)
$Ctx.ExecuteQuery()
$Web.ExcludeFromOfflineClient=$true
$Web.Update()
$Ctx.ExecuteQuery()
Write-Host -f Green "Sync Button is Disabled for the Site:" $($SiteURL)
#Iterate through each subsite of the current web
ForEach ($Subweb in $Ctx.Web.Webs)
{
#Call the function recursively
Disable-SPOSyncButton -SiteURL $Subweb.url
}
}
Catch {
write-host -f Red "Error Disabling Sync Button!" $_.Exception.Message
}
}
#Set parameter values
$SiteURL="https://Yourtenant.sharepoint.com/sites/karley10"
#Replace Username and Password
$Username = '******@tenant.onmicrosoft.com'
$Password = 'Password'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$SecureString = $pass
# Users you password securly
$MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString
#Get Credentials to connect
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($MySecureCreds.Username, $MySecureCreds.Password)
#Call the function
Disable-SPOSyncButton -SiteURL $SiteURL
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.
Hi @Sergio Londono,
I apologize that I didn't make the third part clearer. I will restate that part here. Please forgive me for modifying your comment to remove my tenant's name, as I accidentally gave out my tenant's name.
The purpose of this PowerShell is to hide all sync buttons on a site collection and its subsites. So $SiteURL
is the URL of a site collection. You can modify this URL to achieve sync button hiding for other site collections.
1.Download SharePoint Online Management Shell and install it.
2.Modify the PowerShell commands I provided. Just modify $SiteURL, $Username, and $Password
. The username and password are the ones you use to log in to Share Point Online. Please make sure that the account you are using is the admin of this site collection.
Function Disable-SPOSyncButton([String]$SiteURL)
{
Try{
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Credentials
#Get the Web and Sub Sites
$Web = $Ctx.Web
$Ctx.Load($Web)
$Ctx.Load($Web.Webs)
$Ctx.ExecuteQuery()
$Web.ExcludeFromOfflineClient=$true
$Web.Update()
$Ctx.ExecuteQuery()
Write-Host -f Green "Sync Button is Disabled for the Site:" $($SiteURL)
#Iterate through each subsite of the current web
ForEach ($Subweb in $Ctx.Web.Webs)
{
#Call the function recursively
Disable-SPOSyncButton -SiteURL $Subweb.url
}
}
Catch {
write-host -f Red "Error Disabling Sync Button!" $_.Exception.Message
}
}
#Set parameter values
$SiteURL="https://Your Site Collection URL"
#Replace Username and Password
$Username = '******@tenant.onmicrosoft.com'
$Password = 'YourPassword'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$SecureString = $pass
# Users you password securly
$MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString
#Get Credentials to connect
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($MySecureCreds.Username, $MySecureCreds.Password)
#Call the function
Disable-SPOSyncButton -SiteURL $SiteURL
3.Open SharePoint Online Management Shell.
4.Copy the commands and press Enter to execute it. After success, you can see the green prompt message.
5.Clear your browser cache and then revisit the site collection and you will see that the sync button is hidden on the site collection and all its subsites.
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.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more