Set-SPOSite
Sets or updates one or more properties' values for a site collection.
Syntax
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-AllowSelfServiceUpgrade <Boolean>]
[-Confirm]
[-DenyAddAndCustomizePages <Boolean>]
[-LocaleId <UInt32>]
[-LockState <String>]
[-NoWait]
[-Owner <String>]
[-ResourceQuota <Double>]
[-ResourceQuotaWarningLevel <Double>]
[-SandboxedCodeActivationCapability <SandboxedCodeActivationCapabilities>]
[-BlockDownloadLinksFileType <BlockDownloadLinksFileTypes>]
[-SharingCapability <SharingCapabilities>]
[-StorageQuota <Int64>]
[-StorageQuotaWarningLevel <Int64>]
[-Title <String>]
[-WhatIf]
[-AllowDownloadingNonWebViewableFiles <Boolean>]
[-CommentsOnSitePagesDisabled <Boolean>]
[-SocialBarOnSitePagesDisabled <Boolean>]
[-DisableAppViews <AppViewsPolicy>]
[-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>]
[-DisableFlows <FlowsPolicy>]
[-RestrictedToGeo <RestrictedToRegion>]
[-SharingAllowedDomainList <String>]
[-SharingBlockedDomainList <String>]
[-SharingDomainRestrictionMode <SharingDomainRestrictionModes>]
[-ShowPeoplePickerSuggestionsForGuestUsers <Boolean>]
[-StorageQuotaReset]
[-DefaultSharingLinkType]
[-DefaultLinkPermission]
[-DefaultLinkToExistingAccess]
[-ConditionalAccessPolicy <SPOConditionalAccessPolicyType>]
[-LimitedAccessFileType <SPOLimitedAccessFileType>]
[-AllowEditing <Boolean>]
[-AnonymousLinkExpirationInDays <Int32>]
[-OverrideTenantAnonymousLinkExpirationPolicy <Boolean>]
[-SensitivityLabel <String>]
[-RemoveLabel]
[<CommonParameters>]
Set-SPOSite
[-Identity] <SpoSitePipeBind>
-EnablePWA <Boolean>
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-Confirm]
[-DisableSharingForNonOwners]
[-WhatIf]
[<CommonParameters>]
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-AllowSelfServiceUpgrade <Boolean>]
[-Confirm]
[-DenyAddAndCustomizePages <Boolean>]
[-LocaleId <UInt32>]
[-LockState <String>]
[-NoWait]
[-Owner <String>]
[-ResourceQuota <Double>]
[-ResourceQuotaWarningLevel <Double>]
[-SandboxedCodeActivationCapability <SandboxedCodeActivationCapabilities>]
[-SharingCapability <SharingCapabilities>]
[-StorageQuota <Int64>]
[-StorageQuotaWarningLevel <Int64>]
[<CommonParameters>]
Description
For any parameters that are passed in, the Set-SPOSite
cmdlet sets or updates the setting for the site collection identified by parameter Identity.
You must be a SharePoint Online administrator or Global Administrator and be a site collection administrator to run the cmdlet.
For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell.
For OneDrive for Business site collection, the only valid parameters are Identity, AllowDownloadingNonWebViewableFiles, AllowEditing, ConditionalAccessPolicy, DefaultLinkPermission, DefaultSharingLinkType, DisableCompanyWideSharingLinks, LimitedAccessFileType, LockState, Owner, SharingAllowedDomainList, SharingBlockedDomainList, SharingCapability, SharingDomainRestrictionMode, ShowPeoplePickerSuggestionsForGuestUsers, StorageQuota, and StorageWarningLevel.
For Groups site collection, the only valid parameters are Identity, AllowSelfServiceUpgrade, DefaultLinkPermission, DefaultSharingLinkType, DenyAddAndCustomizePages, DisableCompanyWideSharingLinks, DisableSharingForNonOwners, LockState, Owner, ResourceQuota, ResourceQuotaWarningLevel, SandboxedCodeActivationCapability, SharingCapability, ShowPeoplePickerSuggestionsForGuestUsers, SocialBarOnSitePagesDisabled, StorageQuota, StorageQuotaReset, and StorageQuotaWarningLevel.
Examples
-----------------------EXAMPLE 1-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -Owner joe.healy@contoso.com -NoWait
Example 1 updates the owner of site collection https://contoso.sharepoint.com/sites/site1 to the person whose email address is joe.healy@contoso.com. This cmdlet is executed immediately without delay.
-----------------------EXAMPLE 2-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -ResourceQuota 0 -StorageQuota 1024
Example 2 updates the settings of site collection https://contoso.sharepoint.com/sites/site1. The storage quota is updated to 1024 megabytes (1 GB) and the resource quota is updated to 0 megabytes.
-----------------------EXAMPLE 3-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com -StorageQuota 1500 -StorageQuotaWarningLevel 1400
This example updates the settings of site collection https://contoso.sharepoint.com. The storage quota is updated to 1500 megabytes and the storage quota warning level is updated to 1400 megabytes.
-----------------------EXAMPLE 4-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com -DisableSharingForNonOwners
Example 4 prevents non-owners of a site from inviting new users to the site.
-----------------------EXAMPLE 5-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/groupname -StorageQuota 3000 -StorageQuotaWarningLevel 2000
This example sets the quota for the site.
Note
If Site Collection Storage Management is enabled for the tenant, you will not be able to set quota and will have a generic error returned. To workaround this issue, set the site collection storage management to "manual" temporarily, set your quotas and then set the site collection storage management setting back to its original setting.
-----------------------EXAMPLE 6-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnablePWA $true
Example 6 enables the site "site1" to create Project Web Applications (PWA).
-----------------------EXAMPLE 7-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -SharingCapability ExternalUserSharingOnly
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -SharingDomainRestrictionMode AllowList -SharingAllowedDomainList "contoso.com"
Example 7 sets the Sharing Capability to allow external users who accept sharing invitations and sign in as authenticated users, and then specifies an email domain that is allowed for sharing with the external collaborators.
-----------------------EXAMPLE 8-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/research -AddInformationSegment a17efb47-e3c9-4d85-a188-1cd59c83de32
This example adds InformationSegment 'a17efb47-e3c9-4d85-a188-1cd59c83de32' to the site.
-----------------------EXAMPLE 9-----------------------------
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/research -RemoveInformationSegment a17efb47-e3c9-4d85-a188-1cd59c83de32
In example, InformationSegment 'a17efb47-e3c9-4d85-a188-1cd59c83de32' is removed from the site.
Parameters
This parameter allows you to add a segment to a SharePoint site. This parameter is only applicable for tenants who have enabled Microsoft 365 Information barriers capability. Please read https://docs.microsoft.com/sharepoint/information-barriers documentation to understand Information barriers in SharePoint Online.
Note: This parameter is available only in SharePoint Online Management Shell Version 16.0.19927.12000 or later.
Type: | GUID |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies if non web viewable files can be downloaded.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Prevents users from editing Office files in the browser and copying and pasting Office file contents out of the browser window.
PARAMVALUE: $true | $false
Type: | Boolean |
Position: | Named |
Default value: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Determines whether site collection administrators can upgrade their site collections.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies all anonymous/anyone links that have been created (or will be created) will expire after the set number of days. Only applies if OverrideTenantAnonymousLinkExpirationPolicy is set to true.
To remove the expiration requirement, set the value to zero (0).
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
The valid values are:
- WebPreviewableFiles
- ServerRenderedFilesOnly
Note: ServerRendered (Office Only) and WebPreviewable (All supported files).
The site's value is compared with the tenant level setting and the stricter one wins. For example, if the tenant is set to ServerRenderedFilesOnly then that will be used even if the site is set to WebPreviewableFiles.
Type: | BlockDownloadLinksFileTypes |
Position: | Named |
Default value: | WebPreviewableFiles |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Use this parameter to disable Comments section on Site Pages. The parameter can't be used for Groups Site Collections.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Please read Control access from unmanaged devices documentation here to understand Conditional Access Policy usage in SharePoint Online.
PARAMVALUE: AllowFullAccess | AllowLimitedAccess | BlockAccess
Type: | SPOConditionalAccessPolicyType |
Position: | Named |
Default value: | AllowFullAccess |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
PARAMVALUE: SwitchParameter
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
The default link permission for the site collection
PARAMVALUE: None | View | Edit
- None - Respect the organization default link permission
- View - Sets the default link permission for the site to "view" permissions
- Edit - Sets the default link permission for the site to "edit" permissions
Type: | SharingPermissionType |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
When set to TRUE, the DefaultSharingLinkType will be overriden and the default sharing link will a People with Existing Access link (which does not modify permissions). When set to FALSE (the default), the default sharing link type is controlled by the DefaultSharingLinkType parameter
PARAMVALUE: $true | $false
Type: | SharingLinkType |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
The default link type for the site collection
PARAMVALUE: None | AnonymousAccess | Internal | Direct
- None - Respect the organization default sharing link type
- AnonymousAccess - Sets the default sharing link for this site to an Anonymous Access or Anyone link
- Internal - Sets the default sharing link for this site to the "organization" link or company shareable link
- Direct - Sets the default sharing link for this site to the "Specific people" link
Type: | SharingLinkType |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Determines whether the Add And Customize Pages right is denied on the site collection. For more information about permission levels, see User permissions and permission levels in SharePoint.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Disables the Power Apps button. Possible values:
- Disabled
- NotDisabled
- Unknown (not settable)
Type: | AppViewsPolicy |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Disables People in your organization links. For more information, see People in your organization sharing links. Possible values
- Disabled
- NotDisabled
- Unknown (not settable)
Type: | CompanyWideSharingLinksPolicy |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Disables the Power Automate button. Possible values
- Disabled
- NotDisabled
Type: | FlowsPolicy |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
This parameter prevents non-owners from invited new users to the site.
This parameter is available only in SharePoint Online Management Shell Version 16.0.4613.1211 or later.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Determines whether site can include Project Web App. For more information about Project Web App, see Plan SharePoint groups in Project Server.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the URL of the site collection to update.
Type: | SpoSitePipeBind |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
The following parameters can be used with -ConditionalAccessPolicy AllowLimitedAccess for both the organization-wide setting and the site-level setting.
OfficeOnlineFilesOnly: Allows users to preview only Office files in the browser. This option increases security but may be a barrier to user productivity.
LimitedAccessFileType WebPreviewableFiles (default): Allows users to preview Office files and other file types (such as PDF files and images) in the browser. Note that the contents of file types other than Office files are handled in the browser. This option optimizes for user productivity but offers less security for files that aren't Office files.
LimitedAccessFileType OtherFiles: Allows users to download files that can't be previewed, such as .zip and .exe. This option offers less security.
Type: | SPOLimitedAccessFileType |
Position: | Named |
Default value: | WebPreviewableFiles |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the language of this site collection. For more information, see MS-OE376, LCID.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Sets the lock state on a site.
Valid values are: NoAccess, ReadOnly and Unlock.
When the lock state of a site is ReadOnly, a message will appear on the site stating that the site is under maintenance and it is read-only.
When the lock state of a site is NoAccess, all traffic to the site will be blocked.
If parameter NoAccessRedirectUrl in the Set-SPOTenant
cmdlet is set, traffic to sites that have a lock state NoAccess will be redirected to that URL.
If parameter NoAccessRedirectUrl is not set, a 403 error will be returned.
It isn't possible to set the lock state on the root site collection.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies to continue executing script immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Choose whether to override the anonymous or anyone link expiration policy on this site
PARAMVALUE: None | False | True
- None - Respect the organization-level policy for anonymous or anyone link expiration
- False - Respect the organization-level policy for anonymous or anyone link expiration
- True - Override the organization-level policy for anonymous or anyone link expiration (can be more or less restrictive)
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the owner of the site collection.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
This parameter allows you to remove a segment from a SharePoint site. This parameter is only applicable for tenants who have enabled Microsoft 365 Information barriers capability. Please read https://docs.microsoft.com/sharepoint/information-barriers documentation to understand Information barriers with SharePoint Online.
Note: This parameter is available only in SharePoint Online Management Shell Version 16.0.19927.12000 or later.
Type: | GUID |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
This parameter allows you to remove the assigned sensitivity label on a site.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the resource quota in megabytes of the site collection. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint.
Type: | Double |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the warning level in megabytes of the site collection to warn the site collection administrator that the site is approaching the resource quota.
Type: | Double |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
PARAMVALUE: NoRestriction | BlockMoveOnly | BlockFull | Unknown
Type: | RestrictedToRegion |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
PARAMVALUE: Unknown | Check | Disabled | Enabled
Type: | SandboxedCodeActivationCapabilities |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Used to specify the unique identifier (GUID) of the SensitivityLabel.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies a list of email domains that is allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com".
For additional information about how to restrict a domain sharing, see Restrict sharing of SharePoint and OneDrive content by domain.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies a list of email domains that is blocked or prohibited for sharing with the external collaborators. Use space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com".
For additional information about how to restrict a domain sharing, see Restrict sharing of SharePoint and OneDrive content by domain.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Determines what level of sharing is available for the site. The possible values are: Disabled - don't allow sharing outside your organization, ExistingExternalUserSharingOnly - Allow sharing only with the external users that already exist in your organization's directory, ExternalUserSharingOnly - allow external users who accept sharing invitations and sign in as authenticated users, or ExternalUserAndGuestSharing - allow sharing with all external users, and by using anonymous access links.
For more information about sharing, see Turn external sharing on or off for SharePoint Online (/sharepoint/turn-external-sharing-on-or-off).
Type: | SharingCapabilities |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the sharing mode for external domains.
Possible values are:
- None - Do not restrict sharing by domain
- AllowList - Sharing is allowed only with external users that have account on domains specified within -SharingAllowedDomainList
- BlockList - Sharing is allowed with external users in all domains except in domains specified within -SharingBlockedDomainList
For additional information about how to restrict a domain sharing, see Restrict sharing of SharePoint and OneDrive content by domain.
Type: | SharingDomainRestrictionModes |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
To enable the option to search for existing guest users at Site Collection Level, set this parameter to $true.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Disables or enables the Social Bar for Site Collection.
The Social Bar will appear on all modern SharePoint pages with the exception of the home page of a site. It will give users the ability to like a page, see the number of views, likes, and comments on a page, and see the people who have liked a page.
PARAMVALUE: $true | $false
Type: | Boolean |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the storage quota in megabytes of the site collection.
Type: | Int64 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Resets the OneDrive for Business storage quota to the tenant's new default storage space.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the warning level in megabytes of the site collection to warn the site collection administrator that the site is approaching the storage quota.
Type: | Int64 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
Specifies the title of the site collection.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
The WhatIf switch doesn't work on this cmdlet.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |