OneDrive for Business: How to Hide Sync Button at Tenant Level?

Requirement: Disable Sync button in OneDrive for Business.

How to Turn-Off Sync Icon for OneDrive for Business?
We can disable OneDrive for Business at tenant level using PowerShell.
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

#Set Parameters
$TenantAdminURL= "https://crescent-admin.sharepoint.com"
 
#Setup Credentials to connect
$Cred = Get-Credential
 
Try {
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($TenantAdminURL)
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
 
    #Get tenant object
    $Tenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($Ctx)
    $Ctx.Load($Tenant)
    $Ctx.ExecuteQuery()

    #Disable Sync button for OneDrive 
    $Tenant.HideSyncButtonOnODB = $True
    $Tenant.Update()
    $Ctx.ExecuteQuery()
}
Catch {
    write-host -f Red "Error Updating Tenant Settings!" $_.Exception.Message
}
This hides the sync button for all OneDrive for business sites. Please note, these changes don't take effect immediately! It took 6 hours for me in one case!

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.