Set-SPOSite not working for Group enabled SharePoint Online sites
-
08-02-2021 - |
Вопрос
I'm executing the below script to disable one of the document sharing options:
set-sposite -Identity "https://tenant.sharepoint.com/sites/useraccessmanagement" -DisableCompanyWideSharingLinks Disabled
This script is displaying the below error for all Group enabled SharePoint Online sites but for other sites, it is working as expected.
Error Screenshot and Error Text:
set-sposite : https://tenant.sharepoint.com/sites/UserAccessManagement is a Groups site collection. The valid parameters for this type of site collection are '-Identity', '-AllowSelfServiceUpgrade', '-DefaultLinkPermission', '-DefaultSharingLinkType', '-DenyAddAndCustomizePages', '-DisableCompanyWideSharingLinks', '-DisableSharingForNonOwners', '-LockState', '-Owner', '-ResourceQuota', '-ResourceQuotaWarningLevel', '-SandboxedCodeActivationCapability', '-SharingCapability', '-ShowPeoplePickerSuggestionsForGuestUsers', '-SocialBarOnSitePagesDisabled', '-StorageQuota', '-StorageQuotaReset', and '-StorageQuotaWarningLevel'. At line:1 char:1 + set-sposite -Identity "https://tenant.sharepoint.com/sites/useraccessmanageme ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite
Решение
Update your management shell to a current version; I would strongly suggest using the PowerShell Gallery version for easy updating in the future, if you're currently using the MSI.
You will want to uninstall the MSI version prior to installing the PoSh gallery version.
Другие советы
Run the PowerShell with SharePoint Online Management Shell.
Get started with SharePoint Online Management Shell for your reference:
Similar issue post for your reference: