Edit

Share via


Set-SPORestrictedSiteCreation

Sets or updates one or more group configurations for restricting site creation.

Syntax

Default (Default)

Set-SPORestrictedSiteCreation
    [-Enabled <Boolean>]
    [-Mode <RestrictedSiteCreationMode>]
    [-SiteType <RestrictedSiteCreationSiteType>]
    [-RestrictedSiteCreationGroups <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet sets or updates the configuration or setting for the Restricted Site Creation feature.

Important

You must use version 16.0.25513.12000 (published November 2024) or later of the SharePoint Online Management Shell for these commands to function properly. Earlier versions do not have the current list of site types and will not operate correctly.

Examples

Example 1

Set-SPORestrictedSiteCreation –Enabled:$true

Example 1 enables the restricted site creation feature for the tenant.

Example 2

Set-SPORestrictedSiteCreation –Mode Allow

Example 2 sets restricted site creation to allow mode. In this mode, a user is only able to create a site if they are a member of a group specified for a matching site type.

Example 3

Set-SPORestrictedSiteCreation –SiteType "All" -RestrictedSiteCreationGroups "281e395b-7316-4cb2-b5bb-8881426ee411"

Example 3 updates the policy for the All site type to apply to members of the Microsoft Entra security group with ID 281e395b-7316-4cb2-b5bb-8881426ee411. Members of this group are now either allowed or denied (depending on the current mode) from creating all OneDrive and SharePoint sites.

Example 4

Set-SPORestrictedSiteCreation –SiteType "Team" -RestrictedSiteCreationGroups "78159241-04a9-41d2-8dd4-ac568e9766a3,1f95829b-e1c8-4406-b2be-508c36f4bca5"

Example 4 updates the policy for the Team site type to apply to members of the two specified groups. Members of both specified security groups are now either allowed or denied from creating Team sites, depending on the current mode.

Example 5

Set-SPORestrictedSiteCreation –SiteType "OneDrive" -RestrictedSiteCreationGroups ""

Example 5 clears the policy for the OneDrive site type so that it no longer applies to any users.

Parameters

-Confirm

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

-Enabled

Applicable: SharePoint Online

PARAMVALUE: true | false Enables or disables Restricted Site Creation feature in tenant.

Parameter properties

Type:System.Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Mode

Applicable: SharePoint Online

Specifies whether policies allow or deny users from creating sites. PARAMVALUE: Deny | Allow

  • Deny – a user will be blocked from creating a site if any policy applies to them.
  • Allow – a user will only be allowed to create a site if a policy applies to them.

Note

The restricted site creation mode is shared across all site type policies. It is not possible to use deny mode for one site type and allow mode for a different site type. When the mode is changed, all polices are cleared.

Parameter properties

Type:Microsoft.SharePoint.Administration.SPOnlineProvisioning.RestrictedSiteCreationMode
Default value:None
Accepted values:Deny, Allow
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RestrictedSiteCreationGroups

Applicable: SharePoint Online

A comma-separated list of up to 10 Microsoft Entra security group IDs. When paired with the –SiteType parameter, defines a new policy which applies to the specified groups. Set to the empty string ("") to clear the policy for a site type.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SiteType

Applicable: SharePoint Online

When paired with the –RestrictedSiteCreationGroups parameter, creates a new policy which applies to the specified types of sites.

PARAMVALUE: All | SharePoint | OneDrive | Team | Communication

  • All - OneDrive and all SharePoint sites
  • SharePoint - All SharePoint sites (but not OneDrive)
  • OneDrive - Only OneDrive
  • Team - Only SharePoint team sites (group-connected and classic)
  • Communication - Only SharePoint communication sites

Parameter properties

Type:Microsoft.SharePoint.Administration.SPOnlineProvisioning.RestrictedSiteCreationSiteType
Default value:None
Accepted values:All, SharePoint, OneDrive, Team, Communication
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object