From b51d30f51cd408c8d56e4df1994effc27241e644 Mon Sep 17 00:00:00 2001 From: Chao Date: Mon, 12 Oct 2026 11:06:41 -0700 Subject: [PATCH 1/2] Update Set-SPOSite.md to add HideSyncButtonOnTeamSite and DisableAddShortcutsToOneDrive Adds two new site-level parameters to Set-SPOSite: - `HideSyncButtonOnTeamSite`: hides the Sync button in the document libraries of a single site. - `DisableAddShortcutsToOneDrive`: hides the "Add shortcut to My files" option in the document libraries of a single site. Both are site-scoped counterparts of the existing Set-SPOTenant parameters of the same names, so admins can roll the behavior out site by site. They aren't supported on OneDrive sites. Changes: - Added both parameters to the ParamSet1 syntax block. - Added parameter sections (alphabetical order). - Added Example 27. Engineering PR: https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO.Core/pullrequest/2365994 --- .../Set-SPOSite.md | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md index d65d5bce3..5a9aea45a 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md @@ -68,7 +68,8 @@ Set-SPOSite [-Identity] [-Owner ] [-Title ] [- [-ListsShowHeaderAndNavigation ] [-HidePeoplePreviewingFiles ] [-HidePeopleWhoHaveListsOpen ] [-IsAuthoritative ] [-AllowFileArchive ] [-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled ] [-DisableSiteBranding ] - [-DisableClassicPageBaselineSecurityMode ] + [-DisableClassicPageBaselineSecurityMode ] [-HideSyncButtonOnTeamSite ] + [-DisableAddShortcutsToOneDrive ] [-WhatIf] [-Confirm] [] ``` @@ -404,6 +405,15 @@ Get-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 | Select-Object Example 26 restricts Agent Users from accessing the site and then returns the configured value. The policy is enforced at runtime and doesn't remove existing permissions. +### Example 27 + +```powershell +Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -HideSyncButtonOnTeamSite $true -DisableAddShortcutsToOneDrive $true +Get-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 | Select-Object Url, HideSyncButtonOnTeamSite, DisableAddShortcutsToOneDrive +``` + +Example 27 hides the **Sync** button and the **Add shortcut to My files** option in the document libraries of the site and then returns the configured values. Other sites in the organization aren't affected. + ## PARAMETERS ### -AddInformationSegment @@ -1045,6 +1055,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -DisableAddShortcutsToOneDrive + +> Applicable: SharePoint Online + +Hides the [Add shortcut to My files](https://support.microsoft.com/office/add-shortcuts-to-shared-folders-in-onedrive-for-work-or-school-d66b1347-99b7-4470-9360-ffc048d35a33) option in the document libraries of the site. When `DisableAddShortcutsToOneDrive` is set to `$true`, users can't add shortcuts to the site's folders in their OneDrive. Shortcuts that users already added remain in their OneDrive. + +This setting applies only to the specified site. It can't be set on OneDrive sites. To hide the option for all sites in the organization, use the `DisableAddShortcutsToOneDrive` parameter of [Set-SPOTenant](./Set-SPOTenant.md). + +PARAMVALUE: True | False + +```yaml +Type: System.Boolean +Parameter Sets: ParamSet1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DisableAppViews > Applicable: SharePoint Online @@ -1449,6 +1481,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HideSyncButtonOnTeamSite + +> Applicable: SharePoint Online + +Hides the **Sync** button in the document libraries of the site. When `HideSyncButtonOnTeamSite` is set to `$true`, users can't start syncing the site's libraries with the OneDrive sync app from the browser. + +This setting applies only to the specified site. It can't be set on OneDrive sites. To hide the **Sync** button for all sites in the organization, use the `HideSyncButtonOnTeamSite` parameter of [Set-SPOTenant](./Set-SPOTenant.md). + +PARAMVALUE: True | False + +```yaml +Type: System.Boolean +Parameter Sets: ParamSet1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -HubSiteId > Applicable: SharePoint Online From 3dd93540c47b2530d25ac9c3a26bf09752235710 Mon Sep 17 00:00:00 2001 From: Chao Date: Wed, 14 Oct 2026 13:29:31 -0700 Subject: [PATCH 2/2] Update per-site Sync and Add shortcut parameters to match the shipped design - Set-SPOSite: rename -DisableAddShortcutsToOneDrive to -HideAddShortcutsToOneDrive (UI only; also allowed on OneDrive sites). - Set-SPOSite: -HideSyncButtonOnTeamSite is applied only when Set-SPOTenant -AllowOverrideHideSyncButton is $true; $null returns the site to the organization setting; document EffectiveHideSyncButtonOnTeamSite / EffectiveHideAddShortcutsToOneDrive. - Set-SPOSite: update Example 27. - Set-SPOTenant: add -AllowOverrideHideSyncButton. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3137df6e-7ef7-4576-be23-b36c6c4c897d --- .../Set-SPOSite.md | 63 ++++++++++--------- .../Set-SPOTenant.md | 31 ++++++++- 2 files changed, 65 insertions(+), 29 deletions(-) diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md index 5a9aea45a..78eb81dbf 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOSite.md @@ -69,7 +69,7 @@ Set-SPOSite [-Identity] [-Owner ] [-Title ] [- [-HidePeopleWhoHaveListsOpen ] [-IsAuthoritative ] [-AllowFileArchive ] [-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled ] [-DisableSiteBranding ] [-DisableClassicPageBaselineSecurityMode ] [-HideSyncButtonOnTeamSite ] - [-DisableAddShortcutsToOneDrive ] + [-HideAddShortcutsToOneDrive ] [-WhatIf] [-Confirm] [] ``` @@ -408,11 +408,12 @@ Example 26 restricts Agent Users from accessing the site and then returns the co ### Example 27 ```powershell -Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -HideSyncButtonOnTeamSite $true -DisableAddShortcutsToOneDrive $true -Get-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 | Select-Object Url, HideSyncButtonOnTeamSite, DisableAddShortcutsToOneDrive +Set-SPOTenant -HideSyncButtonOnTeamSite $true -AllowOverrideHideSyncButton $true +Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -HideSyncButtonOnTeamSite $false +Get-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 | Select-Object Url, HideSyncButtonOnTeamSite, EffectiveHideSyncButtonOnTeamSite ``` -Example 27 hides the **Sync** button and the **Add shortcut to My files** option in the document libraries of the site and then returns the configured values. Other sites in the organization aren't affected. +Example 27 hides the **Sync** button for all SharePoint sites in the organization, allows sites to override that setting, and then shows the **Sync** button again on site1. The last command returns the site-level value and the value that's applied to the site. ## PARAMETERS @@ -1055,28 +1056,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DisableAddShortcutsToOneDrive - -> Applicable: SharePoint Online - -Hides the [Add shortcut to My files](https://support.microsoft.com/office/add-shortcuts-to-shared-folders-in-onedrive-for-work-or-school-d66b1347-99b7-4470-9360-ffc048d35a33) option in the document libraries of the site. When `DisableAddShortcutsToOneDrive` is set to `$true`, users can't add shortcuts to the site's folders in their OneDrive. Shortcuts that users already added remain in their OneDrive. - -This setting applies only to the specified site. It can't be set on OneDrive sites. To hide the option for all sites in the organization, use the `DisableAddShortcutsToOneDrive` parameter of [Set-SPOTenant](./Set-SPOTenant.md). - -PARAMVALUE: True | False - -```yaml -Type: System.Boolean -Parameter Sets: ParamSet1 -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DisableAppViews > Applicable: SharePoint Online @@ -1437,6 +1416,31 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HideAddShortcutsToOneDrive + +> Applicable: SharePoint Online + +Hides the [Add shortcut to My files](https://support.microsoft.com/office/add-shortcuts-to-shared-folders-in-onedrive-for-work-or-school-d66b1347-99b7-4470-9360-ffc048d35a33) option in the document libraries of the site. When `HideAddShortcutsToOneDrive` is set to `$true`, the option is hidden for users who browse the site. Shortcuts that users already added remain in their OneDrive. + +This setting applies only to the specified site, which can be a SharePoint site or a OneDrive site. The option is also hidden on every site when the `DisableAddShortcutsToOneDrive` parameter of [Set-SPOTenant](./Set-SPOTenant.md) is set to `$true`, which turns off adding shortcuts for the whole organization. To check whether the option is hidden on a site, see the `EffectiveHideAddShortcutsToOneDrive` property returned by Get-SPOSite. + +> [!NOTE] +> This setting controls only whether the option appears in the browser. Users, scripts, APIs, and agents can still add shortcuts to the site's content by other means. To turn off adding shortcuts for the whole organization, use `Set-SPOTenant -DisableAddShortcutsToOneDrive $true`. + +PARAMVALUE: True | False + +```yaml +Type: System.Boolean +Parameter Sets: ParamSet1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -HidePeoplePreviewingFiles > Applicable: SharePoint Online @@ -1485,9 +1489,12 @@ Accept wildcard characters: False > Applicable: SharePoint Online -Hides the **Sync** button in the document libraries of the site. When `HideSyncButtonOnTeamSite` is set to `$true`, users can't start syncing the site's libraries with the OneDrive sync app from the browser. +Hides or shows the **Sync** button in the document libraries of the site. When `HideSyncButtonOnTeamSite` is set to `$true`, users can't start syncing the site's libraries with the OneDrive sync app from the browser. When it's set to `$false`, the **Sync** button is shown. -This setting applies only to the specified site. It can't be set on OneDrive sites. To hide the **Sync** button for all sites in the organization, use the `HideSyncButtonOnTeamSite` parameter of [Set-SPOTenant](./Set-SPOTenant.md). +This setting applies only to the specified site. It can be set on SharePoint sites, such as team sites and communication sites, but not on OneDrive sites. A site that has no site-level value uses the `HideSyncButtonOnTeamSite` setting of [Set-SPOTenant](./Set-SPOTenant.md). The site-level value is applied only when `AllowOverrideHideSyncButton` is set to `$true` with Set-SPOTenant. To remove the site-level value so that the site uses the organization-level setting again, set this parameter to `$null`. Get-SPOSite returns an empty `HideSyncButtonOnTeamSite` value for a site that has no site-level value; to check which value is applied to a site, see the `EffectiveHideSyncButtonOnTeamSite` property. + +> [!NOTE] +> This setting controls only whether the **Sync** button appears in the browser. Users, scripts, APIs, and agents can still start syncing the site's libraries by other means. To prevent a library from being synced, turn off the library's **Offline Client Availability** setting. PARAMVALUE: True | False diff --git a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOTenant.md b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOTenant.md index 7a7e1a2b0..a7ba29367 100644 --- a/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOTenant.md +++ b/sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/Set-SPOTenant.md @@ -105,6 +105,7 @@ Set-SPOTenant [-MinCompatibilityLevel ] [-MaxCompatibilityLevel ] [-AppBypassInformationBarriers ] [-AppAccessInformationBarriersAllowList ] [-AllOrganizationSecurityGroupId ] [-DisableModernListTemplateIds ] [-EnableModernListTemplateIds ] [-HideSyncButtonOnTeamSite ] + [-AllowOverrideHideSyncButton ] [-AllowGuestUserShareToUsersNotInSiteCollection ] [-StreamLaunchConfig ] [-DelegateRestrictedContentDiscoverabilityManagement ] [-DelegateRestrictedAccessControlManagement ] [-DisableOutlookPSTVersionTrimming ] @@ -244,6 +245,7 @@ Set-SPOTenant [-MinCompatibilityLevel ] [-MaxCompatibilityLevel ] [-AppBypassInformationBarriers ] [-AppAccessInformationBarriersAllowList ] [-AllOrganizationSecurityGroupId ] [-DisableModernListTemplateIds ] [-EnableModernListTemplateIds ] [-HideSyncButtonOnTeamSite ] + [-AllowOverrideHideSyncButton ] [-AllowGuestUserShareToUsersNotInSiteCollection ] [-StreamLaunchConfig ] [-DelegateRestrictedContentDiscoverabilityManagement ] [-DelegateRestrictedAccessControlManagement ] [-DisableOutlookPSTVersionTrimming ] @@ -384,6 +386,7 @@ Set-SPOTenant [-MinCompatibilityLevel ] [-MaxCompatibilityLevel ] [-AppBypassInformationBarriers ] [-AppAccessInformationBarriersAllowList ] [-AllOrganizationSecurityGroupId ] [-DisableModernListTemplateIds ] [-EnableModernListTemplateIds ] [-HideSyncButtonOnTeamSite ] + [-AllowOverrideHideSyncButton ] [-AllowGuestUserShareToUsersNotInSiteCollection ] [-StreamLaunchConfig ] [-DelegateRestrictedContentDiscoverabilityManagement ] [-DelegateRestrictedAccessControlManagement ] [-DisableOutlookPSTVersionTrimming ] @@ -522,7 +525,8 @@ Set-SPOTenant [-MinCompatibilityLevel ] [-MaxCompatibilityLevel ] [-AppBypassInformationBarriers ] [-DefaultOneDriveInformationBarrierMode ] [-AppAccessInformationBarriersAllowList ] [-AllOrganizationSecurityGroupId ] [-DisableModernListTemplateIds ] [-EnableModernListTemplateIds ] - [-HideSyncButtonOnTeamSite ] [-AllowGuestUserShareToUsersNotInSiteCollection ] + [-HideSyncButtonOnTeamSite ] + [-AllowOverrideHideSyncButton ] [-AllowGuestUserShareToUsersNotInSiteCollection ] [-StreamLaunchConfig ] [-DelegateRestrictedContentDiscoverabilityManagement ] [-DelegateRestrictedAccessControlManagement ] [-DisableOutlookPSTVersionTrimming ] [-MediaTranscription ] @@ -660,6 +664,7 @@ Set-SPOTenant [-MinCompatibilityLevel ] [-MaxCompatibilityLevel ] [-AppBypassInformationBarriers ] [-AppAccessInformationBarriersAllowList ] [-AllOrganizationSecurityGroupId ] [-DisableModernListTemplateIds ] [-EnableModernListTemplateIds ] [-HideSyncButtonOnTeamSite ] + [-AllowOverrideHideSyncButton ] [-AllowGuestUserShareToUsersNotInSiteCollection ] [-StreamLaunchConfig ] [-DelegateRestrictedContentDiscoverabilityManagement ] [-DelegateRestrictedAccessControlManagement ] [-DisableOutlookPSTVersionTrimming ] @@ -1355,6 +1360,30 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AllowOverrideHideSyncButton + +> Applicable: SharePoint Online + +Allows a site-level `HideSyncButtonOnTeamSite` value, set with Set-SPOSite, to override the organization-level `HideSyncButtonOnTeamSite` setting. + +The valid values are: + +- False (default) - The organization-level setting applies to every site. Site-level values are saved but not applied. + +- True - Sites that have a site-level value use it. Other sites use the organization-level setting. + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AllowSelectSecurityGroupsInSPSitesList > Applicable: SharePoint Online