Set-SPOSite
Sets or updates one or more properties' values for a site collection.
Syntax
None (Default)
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ParamSet1
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-Owner <String>]
[-Title <String>]
[-StorageQuota <Int64>]
[-StorageQuotaWarningLevel <Int64>]
[-ResourceQuota <Double>]
[-ResourceQuotaWarningLevel <Double>]
[-LocaleId <UInt32>]
[-AllowSelfServiceUpgrade <Boolean>]
[-NoWait]
[-LockState <String>]
[-DenyAddAndCustomizePages <Boolean>]
[-SharingCapability <SharingCapabilities>]
[-ShowPeoplePickerSuggestionsForGuestUsers <Boolean>]
[-StorageQuotaReset]
[-SandboxedCodeActivationCapability <SandboxedCodeActivationCapabilities>]
[-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>]
[-SharingDomainRestrictionMode <SharingDomainRestrictionModes>]
[-SharingAllowedDomainList <String>]
[-SharingBlockedDomainList <String>]
[-ConditionalAccessPolicy <SPOConditionalAccessPolicyType>]
[-AllowDownloadingNonWebViewableFiles <Boolean>]
[-LimitedAccessFileType <SPOLimitedAccessFileType>]
[-AllowEditing <Boolean>]
[-ReadOnlyForUnmanagedDevices <Boolean>]
[-SensitivityLabel <String>]
[-DisableAppViews <AppViewsPolicy>]
[-DisableFlows <FlowsPolicy>]
[-MediaTranscription <MediaTranscriptionPolicyType>]
[-BlockDownloadPolicy <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ReadOnlyForBlockDownloadPolicy <Boolean>]
[-ExcludeBlockDownloadSharePointGroups <String[]>]
[-AuthenticationContextName <String>]
[-AuthenticationContextAccessType <SPOAuthenticationContextPolicyAccessType>]
[-RestrictedToGeo <RestrictedToRegion>]
[-CommentsOnSitePagesDisabled <Boolean>]
[-UpdateUserTypeFromAzureAD]
[-SocialBarOnSitePagesDisabled <Boolean>]
[-HubSiteId <Guid>]
[-DefaultSharingLinkType <SharingLinkType>]
[-DefaultLinkPermission <SharingPermissionType>]
[-DefaultLinkToExistingAccess <Boolean>]
[-DefaultLinkToExistingAccessReset]
[-AnonymousLinkExpirationInDays <Int32>]
[-OverrideTenantAnonymousLinkExpirationPolicy <Boolean>]
[-ExternalUserExpirationInDays <Int32>]
[-OverrideTenantExternalUserExpirationPolicy <Boolean>]
[-OrganizationSharingLinkMaxExpirationInDays <Int32>]
[-OrganizationSharingLinkRecommendedExpirationInDays <Int32>]
[-OverrideTenantOrganizationSharingLinkExpirationPolicy <Boolean>]
[-AnyoneSharingLinkRecommendedExpirationInDays <Int32>]
[-InformationBarriersMode <String>]
[-BlockDownloadLinksFileType <BlockDownloadLinksFileTypes>]
[-OverrideBlockUserInfoVisibility <SiteUserInfoVisibilityPolicyValue>]
[-LoopDefaultSharingLinkScope <SharingScope>]
[-LoopDefaultSharingLinkRole <SharingRole>]
[-RequestFilesLinkEnabled <Boolean>]
[-RequestFilesLinkExpirationInDays <Int32>]
[-OverrideSharingCapability <Boolean>]
[-DefaultMainLinkScope <MainLinkAudience>]
[-DefaultShareLinkScope <SharingScope>]
[-DefaultShareLinkRole <SharingRole>]
[-BlockGuestsAsSiteAdmin <SharingState>]
[-RestrictContentOrgWideSearch <Boolean>]
[-RestrictedContentDiscoveryforCopilotAndAgents <Boolean>]
[-RestrictedAccessControl <Boolean>]
[-RestrictedAccessControlGroups <Guid[]>]
[-ListsShowHeaderAndNavigation <Boolean>]
[-HidePeoplePreviewingFiles <Boolean>]
[-HidePeopleWhoHaveListsOpen <Boolean>]
[-IsAuthoritative <Boolean>]
[-AllowFileArchive <Boolean>]
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
[-DisableSiteBranding <Boolean>]
[-DisableClassicPageBaselineSecurityMode <Boolean>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ParamSet2
Set-SPOSite
[-Identity] <SpoSitePipeBind>
-EnablePWA <Boolean>
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ParamSet3
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-DisableSharingForNonOwners]
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ParamSet5
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-RemoveLabel]
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AddInformationBarrierSegments
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-AddInformationSegment <Guid[]>]
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
RemoveInformationBarrierSegments
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-RemoveInformationSegment <Guid[]>]
[-InformationBarriersMode <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ClearLockDown
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-ClearSharingLockDown]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
AddRestrictedAccessControlGroups
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-AddRestrictedAccessControlGroups <Guid[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
RemoveRestrictedAccessControlGroups
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-RemoveRestrictedAccessControlGroups <Guid[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ClearRestrictedAccessControl
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-ClearRestrictedAccessControl]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
InheritVersionPolicyFromTenant
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-InheritVersionPolicyFromTenant]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetSiteFileVersionPolicy
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-EnableAutoExpirationVersionTrim <Boolean>]
[-ExpireVersionsAfterDays <Int32>]
[-MajorVersionLimit <Int32>]
[-MajorWithMinorVersionsLimit <Int32>]
[-ApplyToNewDocumentLibraries]
[-ApplyToExistingDocumentLibraries]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetSiteFileTypeFileVersionPolicy
Set-SPOSite
[-Identity] <SpoSitePipeBind>
-FileTypesForVersionExpiration <String[]>
[-InformationBarriersMode <String>]
[-EnableAutoExpirationVersionTrim <Boolean>]
[-ExpireVersionsAfterDays <Int32>]
[-MajorVersionLimit <Int32>]
[-ApplyToNewDocumentLibraries]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
RemoveSiteFileVersionPolicy
Set-SPOSite
[-Identity] <SpoSitePipeBind>
-RemoveVersionExpirationFileTypeOverride <String[]>
[-InformationBarriersMode <String>]
[-ApplyToNewDocumentLibraries]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ClearGroupId
Set-SPOSite
[-Identity] <SpoSitePipeBind>
[-InformationBarriersMode <String>]
[-ClearGroupId]
[-WhatIf]
[-Confirm]
[<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 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, SensitivityLabel, 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 -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).
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.
Example 10
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/research -ConditionalAccessPolicy AuthenticationContext -AuthenticationContextName "MFA"
In this example, an authentication context called MFA is attached to the site.
Example 11
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $true
Example 11 sets automatic version history limits at the site level. Automatic setting will be applied to all new document libraries created in the site and a background request will be created to asynchronously process the update on existing document libraries that have versioning enabled.
EXAMPLE 12
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -MajorWithMinorVersionsLimit 20 -ExpireVersionsAfterDays 30
Example 12 sets manual version history limits at the site level by limiting the number of versions and the time (in days) versions are kept. The new document libraries will use this version setting. Also it creates a job to set this manual version setting for existing document libraries that enabled versioning.
EXAMPLE 13
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -MajorWithMinorVersionsLimit 20 -ExpireVersionsAfterDays 0
Example 13 sets manual version history limits at the site level by limiting the number of versions with no time limits. The new document libraries will use this version setting. Also it creates a job to set this manual version setting for existing document libraries that enabled versioning.
Example 14
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $true -ApplyToNewDocumentLibraries
Example 14 sets automatic version history limits at the site level. The new document libraries will use this version setting.
EXAMPLE 15
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 30 -ApplyToNewDocumentLibraries
Example 15 sets manual version history limits at the site level by limiting the number of versions and the time (in days) versions are kept. The new document libraries will use this version setting.
EXAMPLE 16
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 0 -ApplyToNewDocumentLibraries
Example 16 sets manual version history limits at the site level by limiting the number of versions with no time limits. The new document libraries will use this version setting.
Example 17
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $true -ApplyToExistingDocumentLibraries
Example 17 creates a job to set automatic version history limits for existing document libraries that enabled versioning.
EXAMPLE 18
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -MajorWithMinorVersionsLimit 20 -ExpireVersionsAfterDays 30 -ApplyToExistingDocumentLibraries
Example 18 creates a job to set manual version history limits that limits the number of versions and the time (in days) versions are kept for existing document libraries that enabled versioning.
EXAMPLE 19
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -MajorWithMinorVersionsLimit 20 -ExpireVersionsAfterDays 0 -ApplyToExistingDocumentLibraries
Example 19 creates a request to set manual version history limits that limits the number of versions with no time limits for existing document libraries that enabled versioning.
EXAMPLE 20
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -InheritVersionPolicyFromTenant
Example 20 clears the file version setting at the site level. The new document libraries will use the Tenant Level setting. It won't impact the existing document libraries.
Example 21
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $true -FileTypesForVersionExpiration @("Video", "Audio") -ApplyToNewDocumentLibraries
Example 21 sets automatic version history limit override for video and audio file types at the site level. The new document libraries will use this version setting.
Example 22
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 30
-FileTypesForVersionExpiration @("Video", "Audio") -ApplyToNewDocumentLibraries
Example 22 sets manual version history limit override for video and audio file types at the site level by limiting the number of versions and the time (in days) versions are kept. The new document libraries will use this version setting.
Example 23
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -EnableAutoExpirationVersionTrim $false -MajorVersionLimit 500 -ExpireVersionsAfterDays 0
-FileTypesForVersionExpiration @("Video", "Audio") -ApplyToNewDocumentLibraries
Example 23 sets manual version history limit override for video and audio file types at the site level by limiting the number of versions with no time limits. The new document libraries will use this version setting.
Example 24
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -RemoveVersionExpirationFileTypeOverride @("Video", "Audio") -ApplyToNewDocumentLibraries
Example 24 removes the version history limit override for video and audio file types at the site level. The new document libraries will use this version setting.
Parameters
-AddInformationSegment
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://learn.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.
Parameter properties
| Type: | System.Guid[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
AddInformationBarrierSegments
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AddRestrictedAccessControlGroups
Applicable: SharePoint Online
Specifies the IDs of groups to be added to an access restriction policy and gain access.
Parameter properties
| Type: | System.Guid[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
AddRestrictedAccessControlGroups
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AllowDownloadingNonWebViewableFiles
Applicable: SharePoint Online
Specifies if non web viewable files can be downloaded.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AllowEditing
Applicable: SharePoint Online
Prevents users from editing Office files in the browser and copying and pasting Office file contents out of the browser window.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AllowFileArchive
Applicable: SharePoint Online
This setting enables or disables the file archive feature for a SharePoint site. If this parameter is passed as true for a site and Microsoft 365 Archive is enabled at the tenant-level, then the site will allow file archive.
PARAMVALUE: False | True
If set to True, the feature will be enable. Feature is disabled by default.
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AllowSelfServiceUpgrade
Applicable: SharePoint Online
Determines whether site collection administrators can upgrade their site collections.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled
Applicable: SharePoint Online
Enables or disables web property bag updates. When AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled is set to $true, the web property bag can be updated even if the Add And Customize Pages right is denied on the site collection.
PARAMVALUE: True | False
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AnonymousLinkExpirationInDays
Applicable: 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.
The valid number should be between 1 and 730. To remove the expiration requirement, set the value to zero (0).
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AnyoneSharingLinkRecommendedExpirationInDays
Applicable: SharePoint Online
Specifies the recommended number of days before Anyone (anonymous) sharing links expire for this site. This setting provides a suggested expiration period to users when they create sharing links. Only applies if OverrideTenantAnonymousLinkExpirationPolicy is set to true.
The value can be from 1 to 730 days and must be less than or equal to the maximum expiration value set by AnonymousLinkExpirationInDays.
When set to 0, the default value will be AnonymousLinkExpirationInDays.
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ApplyToExistingDocumentLibraries
Applicable: SharePoint Online
Create a job to apply the version history limits setting to existing document libraries.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SetSiteFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ApplyToNewDocumentLibraries
Applicable: SharePoint Online
Apply the version history limits setting to new document libraries.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SetSiteFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
RemoveSiteFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AuthenticationContextAccessType
Applicable: SharePoint Online
Controls whether Authentication Context Limited Access is enabled for a site.
The valid values are:
- AllowLimitedAccess
- BlockAccess
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.SPOAuthenticationContextPolicyAccessType |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AuthenticationContextName
Applicable: SharePoint Online
The conditional access authentication context name.
Parameter properties
| Type: | System.String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-BlockDownloadLinksFileType
Applicable: 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.
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.BlockDownloadLinksFileTypes |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-BlockDownloadPolicy
Applicable: SharePoint Online
As a SharePoint administrator in Microsoft 365, you can block the download of files from SharePoint sites or OneDrive. This feature does not need Microsoft Entra Conditional Access policies. This feature can be set for individual sites but not at the organization level.
Blocking the download of files allows users to remain productive while addressing the risk of accidental data loss. Users have browser-only access with no ability to download, print, or sync files. They also won't be able to access content through apps, including the Microsoft Office desktop apps. When web access is limited, users will see the following message at the top of sites: "Your organization doesn't allow you to download, print, or sync from this site. For help contact your IT department." Read the full documentation for advanced capabilities at Block download policy for SharePoint sites and OneDrive.
Note
If BlockDownloadPolicy is enabled for a site that hosts a site collection app catalog, uploading or updating SharePoint Framework solution packages (.sppkg) can fail with App package is invalid, and the Product ID remains blank. Temporarily disable BlockDownloadPolicy while uploading or updating packages, and re-enable it afterward.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-BlockGuestsAsSiteAdmin
Applicable: SharePoint Online
Whether to block guests as site admins.
Parameter properties
| Type: | Microsoft.SharePoint.Client.SharingState |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ClearGroupId
This parameter allows you to remove the assigned Microsoft 365 group ID on a site, when the group is permanently deleted.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ClearGroupId
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ClearRestrictedAccessControl
Applicable: SharePoint Online
Clears the list of groups that are given access via an access restriction policy.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ClearRestrictedAccessControl
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ClearSharingLockDown
Applicable: SharePoint Online
Whether to clear the sharing lockdown for the site.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ClearLockDown
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-CommentsOnSitePagesDisabled
Applicable: SharePoint Online
Use this parameter to disable Comments section on Site Pages. The parameter can't be used for Groups Site Collections.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ConditionalAccessPolicy
Applicable: SharePoint Online
Please read Control access from unmanaged devices documentation here to understand Conditional Access Policy usage in SharePoint Online.
Possible values:
- AllowFullAccess: Allows full access from desktop apps, mobile apps, and the web.
- AllowLimitedAccess: Allows limited, web-only access.
- BlockAccess: Blocks Access.
- AuthenticationContext: Assign a Microsoft Entra authentication context. Must add the AuthenticationContextName. Please read Configure authentication contexts.
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.SPOConditionalAccessPolicyType |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Confirm
Applicable: SharePoint Online
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultLinkPermission
Applicable: SharePoint Online
The default link permission for the site collection. To be replaced by DefaultShareLinkRole.
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
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.SharingPermissionType |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultLinkToExistingAccess
Applicable: SharePoint Online
When set to TRUE, the DefaultSharingLinkType will be overriden and the default sharing link will be a People with Existing Access link (which does not modify permissions). When set to FALSE (the default), the DefaultSharingLinkType parameter controls the default sharing link type.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultLinkToExistingAccessReset
Applicable: SharePoint Online
Whether to reset the default link to existing access to the site.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultMainLinkScope
Applicable: SharePoint Online
The default audience for main links used in sharing. Applies to all items at the root of the document library. Only audience scope is set by this parameter. The default effective value is OnlyPeopleAdded.
The valid values are:
- OnlyPeopleAdded
- Organization
- Anyone
Anyone is only available if anonymous links are allowed at the tenant level. If Anyone is selected but the site has Anyone links disabled, the effective default falls back to the next most restrictive value.
Parameter properties
| Type: | Microsoft.SharePoint.Sharing.MainLinkAudience |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultShareLinkRole
Applicable: SharePoint Online
The default share link role for the site collection. It replaces DefaultLinkPermission.
The valid values are:
- Edit
- None
- RestrictedView
- Review
- View
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.SharingRole |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultShareLinkScope
Applicable: SharePoint Online
The default share link scope on the site. It replaces DefaultSharingLinkType.
The valid values are:
- Anyone
- Organization
- SpecificPeople
- Uninitialized
Parameter properties
| Type: | Microsoft.SharePoint.Client.Sharing.SharingScope |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultSharingLinkType
Applicable: SharePoint Online
The default link type for the site collection. To be replaced by DefaultShareLinkScope.
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
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantManagement.SharingLinkType |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DenyAddAndCustomizePages
Applicable: 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.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableAppViews
Applicable: SharePoint Online
Note: This parameter has been retired and no longer functions.
Disables the Power Apps button. Possible values:
- Disabled
- NotDisabled
- Unknown (not settable)
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantAdministration.AppViewsPolicy |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableClassicPageBaselineSecurityMode
Applicable: SharePoint Online
Allows a site to disable baseline security mode for classic pages. When DisableClassicPageBaselineSecurityMode is set to $true, users can create and edit classic pages even if baseline security mode is enabled at the tenant level in Microsoft admin center.
PARAMVALUE: True | False
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableCompanyWideSharingLinks
Applicable: 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)
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantAdministration.CompanyWideSharingLinksPolicy |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableFlows
Applicable: SharePoint Online
Note: This parameter has been retired and no longer functions.
Disables the Power Automate button. Possible values
- Disabled
- NotDisabled
Parameter properties
| Type: | Microsoft.Online.SharePoint.TenantAdministration.FlowsPolicy |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableSharingForNonOwners
Applicable: SharePoint Online
This parameter prevents non-owners from inviting new users to the site.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet3
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DisableSiteBranding
Applicable: SharePoint Online
Enables or disables site branding. When DisableSiteBranding is set to $true, the site branding is disabled on the site collection.
PARAMVALUE: True | False
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-EnableAutoExpirationVersionTrim
Applicable: SharePoint Online
SharePoint Administrators can set site-level version history limit settings that universally apply to new versions created on all new document libraries created on the site. Also can create request to set the version setting for existing libraries that enabled versioning.
When version history limits are managed automatically, SharePoint employs an algorithm behind the scenes that deletes (thins out) intermittent older versions that are least likely to be needed, while preserving sufficient high-value versions - more versions in the recent past and fewer farther back in time - in case restores are required.
The valid values are:
- True - Version history limits for new versions created on new/existing document libraries in the site will be managed automatically.
- False - Version history limits for new Versions created on new/existing document libraries in the site will be managed manually by setting limits to the number of major versions (
MajorVersionLimit), number of major with minor versions (MajorWithMinorVersionsLimit) and time set (ExpireVersionsAfterDays). Review the documentation of both parameters to manage your organization's version limits manually.
Note
When version history limits are managed manually (EnableAutoExpirationVersionTrim $false), MajorVersionLimit and ExpireVersionsAfterDays are both required parameters, MajorWithMinorVersionsLimit is also required for creating request for setting existing document libraries with the following acceptable values:
a. MajorVersionLimit accepts values from 1 through 50,000 (inclusive).
b. MajorWithMinorVersionsLimit accepts values from 0 through 50,000 (inclusive).
c. ExpireVersionsAfterDays accepts values of 0 to Never Expire or values >= 30 to delete versions that exceed that time period.
When version history limits are managed automatically (EnableAutoExpirationVersionTrim $true), setting MajorVersionLimit or ExpireVersionsAfterDays will result in an error as the count limits are set by the service.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SetSiteFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
SetSiteFileTypeFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-EnablePWA
Applicable: SharePoint Online
Determines whether site can include Project Web App. For more information about Project Web App, see Plan SharePoint groups in Project Server.
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet2
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ExcludeBlockDownloadPolicySiteOwners
Applicable: SharePoint Online
Controls if site owners are excluded from block download policy.
PARAMVALUE: False | True
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ExcludeBlockDownloadSharePointGroups
Applicable: SharePoint Online
Specifies the groups excluded from the block download policy.
Parameter properties
| Type: | System.String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ExcludedBlockDownloadGroupIds
Applicable: SharePoint Online
Exempts users from specified groups from the block download policy and they can fully download any content for the site.
Parameter properties
| Type: | System.Guid[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ExpireVersionsAfterDays
Applicable: SharePoint Online
When version history limits are managed manually (EnableAutoExpirationVersionTrim $false), admins will need to set the limits to the number of major versions (MajorVersionLimit), the number of major with minor versions (MajorWithMinorVersionsLimit) and the time period the versions are stored (ExpireVersionsAfterDays). Please check the description of EnableAutoExpirationVersionTrim for more details.
PARAMVALUE: Int32
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SetSiteFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
SetSiteFileTypeFileVersionPolicy
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-ExternalUserExpirationInDays
Applicable: SharePoint Online
Specifies all external user expiration which will expire after the set number of days. Only applies if OverrideTenantExternalUserExpirationPolicy is set to true.
The maximum value is 730. To remove the expiration requirement, set the value to zero (0).
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
ParamSet1
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-FileTypesForVersionExpiration
Applicable: SharePoint Online
An array of file type names. The supported file type names are:
- Audio
- OutlookPST
- Video
Apply the version history limits to a set of file types so that they no longer follow the default version history limits. It is used in combination with the following parameters:
This must be used with ApplyToNewDocumentLibraries switch set to true, because the version history limits are only applied on new document libraries in the site.
Note
This feature is currently in preview and may not be available in your tenant.
Parameter properties
| Type: | String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
SetSiteFileTypeFileVersionPolicy
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-HidePeoplePreviewingFiles
Applicable: SharePoint Online
This setting disables the feature in OneDrive and SharePoint file previewing that displays the presence of other users on the file. It does not affect any experiences outside of the previewer.
PARAMVALUE: False | True
If set to True, the presence of other users on the file will no longer be displayed.
Parameter properties
| Type: | System.Boolean |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |