Commands › SharePoint Online

Set-SPOContainer

SharePoint Online Microsoft.Online.SharePoint.PowerShell Set-*

Sets or updates one or more property values for a container in SharePoint Embedded.

Quick start script

# Set-SPOContainer — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPOContainer
$before | Format-List

# 3. Make the change (dry run first)
Set-SPOContainer -CurrentPrincipalOwner <String> -Identity <SPOContainerPipeBind> -NewPrincipalOwner <String> -WhatIf
Set-SPOContainer -CurrentPrincipalOwner <String> -Identity <SPOContainerPipeBind> -NewPrincipalOwner <String>

# 4. Verify and diff
$after = Get-SPOContainer
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 13 parameter sets

ParamSet1

Set-SPOContainer [-Identity] <SPOContainerPipeBind> [[-SensitivityLabel] <String>]
 [-InformationBarriersMode <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

BlockDownloadPolicy

Set-SPOContainer [-Identity] <SPOContainerPipeBind> [-BlockDownloadPolicy <Boolean>]
 [-ExcludeBlockDownloadPolicyContainerOwners <Boolean>] [-ReadOnlyForBlockDownloadPolicy <Boolean>]
 [-InformationBarriersMode <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

RestrictedAccessControl

Set-SPOContainer [-Identity] <SPOContainerPipeBind> [-EnableRestrictedAccessControl <Boolean>]
 [-RestrictedAccessControlGroups <Guid[]>] [-InformationBarriersMode <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

RestrictedAccessControlGroupsToAdd

Set-SPOContainer [-Identity] <SPOContainerPipeBind> [-RestrictedAccessControlGroupsToAdd <Guid[]>]
 [-InformationBarriersMode <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

9 more parameter sets — see the parameter table below.

Parameters (27)

ParameterTypeRequiredWhat it controls
-AddInformationSegment Guid[] This parameter allows you to add a segment to a SharePoint Embedded container. To use this parameter, your tenant must have Microsoft 365 Information Barriers enabled. For more information, see [Use Information...
-AllowEditing Boolean Prevents users from editing Office files in the browser and copying and pasting Office file contents out of the browser window.
-AuthenticationContextName String The conditional access authentication context name.
-BlockDownloadPolicy Boolean As a SharePoint Embedded Administrator, you can block the download of files from SharePoint Embedded containers. This feature does not need Microsoft Entra Conditional Access policies. This feature can be set for...
-ClearRestrictedAccessControl SwitchParameter Clears the list of groups that are given access via an access restriction policy.
-ConditionalAccessPolicy SPOConditionalAccessPolicyType Read the [Control access from unmanaged devices](/sharepoint/control-access-from-unmanaged-devices) documentation to understand Conditional Access Policy usage in SharePoint Embedded container.
-CurrentPrincipalOwner String yes The current principal owner of the container.
-EnableRestrictedAccessControl Boolean Allows you and other SharePoint Embedded admins restrict access to containers.
-ExcludeBlockDownloadPolicyContainerOwners Boolean Specifies whether container owners are excluded from block download policy.
-Identity SPOContainerPipeBind yes Use this parameter to specify the container url.
-InformationBarriersMode String Specifies the information barrier mode.
-LimitedAccessFileType SPOLimitedAccessFileType The following parameters can be used with -ConditionalAccessPolicy AllowLimitedAccess for both the organization-wide setting and the container-level setting.
-NewPrincipalOwner String yes The new user to whom a user-owned container's lifecycle will be tied to.
-ReadOnlyForBlockDownloadPolicy Boolean Controls if read-only should be enabled for block download policy.
-ReadOnlyForUnmanagedDevices Boolean Controls whether unmanaged devices have read-only access.
-RemoveInformationSegment Guid[] This parameter allows you to remove a segment from a SharePoint Embedded container. This parameter is available only for tenants with Microsoft 365 Information Barriers enabled.
-RemoveLabel SwitchParameter This parameter allows you to remove the assigned sensitivity label on a container.
-RestrictContentOrgWideSearch Boolean Controls whether org-wide content search is enabled for a container.
-RestrictedAccessControlGroups Guid[] Specifies the group IDs that have access under an access restriction policy.
-RestrictedAccessControlGroupsToAdd Guid[] Specifies the group IDs to add to an access restriction policy to grant access.
-RestrictedAccessControlGroupsToRemove Guid[] Specifies the group IDs to remove from an access restriction policy to revoke access.
-SensitivityLabel String Specifies the unique identifier (GUID) of the SensitivityLabel.
-SharingAllowedDomainList String Specifies a list of email domains that are allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com".
-SharingBlockedDomainList String Specifies a list of email domains that are 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".
-SharingDomainRestrictionMode SharingDomainRestrictionModes Specifies the sharing mode for external domains.
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Message Center changes mentioning this command

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.