Commands › SharePoint Online

Set-SPORestrictedSiteCreationForApps

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

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

Quick start script

# Set-SPORestrictedSiteCreationForApps — 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-SPORestrictedSiteCreationForApps
$before | Format-List

# 3. Make the change (dry run first)
Set-SPORestrictedSiteCreationForApps  -WhatIf
Set-SPORestrictedSiteCreationForApps

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

Syntax

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

Parameters (7)

ParameterTypeRequiredWhat it controls
-Enabled Boolean PARAMVALUE: true | false Enables or disables Restricted Site Creation For Apps feature in tenant.
-Mode RestrictedSiteCreationMode Specifies whether policies allow or deny apps from creating sites. PARAMVALUE: Deny | Allow - Deny – an app will be blocked from creating a site if any policy applies to them. - Allow – an app will only be allowed to...
-RestrictedSiteCreationApps String A comma-separated list of up to 100 app IDs. When paired with the `–SiteType` parameter, defines a new policy which applies to the specified apps. Set to the empty string `""` to clear the policy for a site type.
-AuditOnly Boolean Shows what would happen if the cmdlet runs without enforcing the policy by only giving audit events when site creation is restricted.
-SiteType RestrictedSiteCreationSiteType When paired with the `–RestrictedSiteCreationApps` parameter, creates a new policy which applies to the specified types of sites.
-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.

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