|
| 1 | +--- |
| 2 | +external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml |
| 3 | +Module Name: Microsoft.Online.SharePoint.PowerShell |
| 4 | +online version: https://learn.microsoft.com/powershell/module/microsoft.online.sharepoint.powershell/set-sporestrictedsitecreationforapps |
| 5 | +applicable: SharePoint Online |
| 6 | +title: Set-SPORestrictedSiteCreationForApps |
| 7 | +schema: 2.0.0 |
| 8 | +author: vgaddam-pm |
| 9 | +ms.author: vgaddam |
| 10 | +ms.reviewer: jmcdowe |
| 11 | +--- |
| 12 | + |
| 13 | +# Set-SPORestrictedSiteCreationForApps |
| 14 | + |
| 15 | +## SYNOPSIS |
| 16 | + |
| 17 | +Sets or updates one or more app configurations for restricting site creation. |
| 18 | + |
| 19 | +## SYNTAX |
| 20 | + |
| 21 | +``` |
| 22 | +Set-SPORestrictedSiteCreationForApps [-Enabled <Boolean>] [-Mode <RestrictedSiteCreationMode>] |
| 23 | + [-SiteType <RestrictedSiteCreationSiteType>] [-RestrictedSiteCreationApps <String>] [-WhatIf] [-Confirm] |
| 24 | + [<CommonParameters>] |
| 25 | +``` |
| 26 | + |
| 27 | +## DESCRIPTION |
| 28 | + |
| 29 | +This cmdlet sets or updates the configuration or setting for the Restricted Site Creation For Apps feature. |
| 30 | + |
| 31 | +> [!Note] |
| 32 | +> This feature is currently in preview and may not be available in your tenant. |
| 33 | +
|
| 34 | +## EXAMPLES |
| 35 | + |
| 36 | +### Example 1 |
| 37 | + |
| 38 | +```powershell |
| 39 | +Set-SPORestrictedSiteCreationForApps –Enabled:$true |
| 40 | +``` |
| 41 | + |
| 42 | +Example 1 enables the restricted site creation for apps feature for the tenant. |
| 43 | + |
| 44 | +### Example 2 |
| 45 | + |
| 46 | +```powershell |
| 47 | +Set-SPORestrictedSiteCreationForApps –Mode Allow |
| 48 | +``` |
| 49 | + |
| 50 | +Example 2 sets restricted site creation for apps to allow mode. In this mode, an app is only able to create a site if that app is in the list specified for a matching site type. |
| 51 | + |
| 52 | +### Example 3 |
| 53 | + |
| 54 | +```powershell |
| 55 | +Set-SPORestrictedSiteCreationForApps –SiteType "All" -RestrictedSiteCreationApps "281e395b-7316-4cb2-b5bb-8881426ee411" |
| 56 | +``` |
| 57 | + |
| 58 | +Example 3 updates the policy for the `All` site type to apply to the app with the app ID 281e395b-7316-4cb2-b5bb-8881426ee411. This app is now either allowed or denied (depending on the current mode) from creating all OneDrive and SharePoint sites. |
| 59 | + |
| 60 | +### Example 4 |
| 61 | + |
| 62 | +```powershell |
| 63 | +Set-SPORestrictedSiteCreationForApps –SiteType "Team" -RestrictedSiteCreationApps "78159241-04a9-41d2-8dd4-ac568e9766a3,1f95829b-e1c8-4406-b2be-508c36f4bca5" |
| 64 | +``` |
| 65 | + |
| 66 | +Example 4 updates the policy for the `Team` site type to apply to the two apps specified. Both apps now either allowed or denied from creating Team sites, depending on the current mode. |
| 67 | + |
| 68 | +### Example 5 |
| 69 | + |
| 70 | +```powershell |
| 71 | +Set-SPORestrictedSiteCreationForApps –SiteType "OneDrive" -RestrictedSiteCreationApps "" |
| 72 | +``` |
| 73 | + |
| 74 | +Example 5 clears the policy for the `OneDrive` site type so that it no longer applies to any apps. |
| 75 | + |
| 76 | +## PARAMETERS |
| 77 | + |
| 78 | +### -Enabled |
| 79 | + |
| 80 | +> Applicable: SharePoint Online |
| 81 | +
|
| 82 | +PARAMVALUE: true | false |
| 83 | +Enables or disables Restricted Site Creation For Apps feature in tenant. |
| 84 | + |
| 85 | +```yaml |
| 86 | +Type: System.Boolean |
| 87 | +Parameter Sets: (All) |
| 88 | +Aliases: |
| 89 | + |
| 90 | +Required: False |
| 91 | +Position: Named |
| 92 | +Default value: None |
| 93 | +Accept pipeline input: False |
| 94 | +Accept wildcard characters: False |
| 95 | +``` |
| 96 | +
|
| 97 | +### -Mode |
| 98 | +
|
| 99 | +> Applicable: SharePoint Online |
| 100 | +
|
| 101 | +Specifies whether policies allow or deny apps from creating sites. |
| 102 | +PARAMVALUE: Deny | Allow |
| 103 | +- Deny – an app will be blocked from creating a site if any policy applies to them. |
| 104 | +- Allow – an app will only be allowed to create a site if a policy applies to them. |
| 105 | +
|
| 106 | +> [!NOTE] |
| 107 | +> 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 policies are cleared. |
| 108 | +
|
| 109 | +```yaml |
| 110 | +Type: Microsoft.SharePoint.Administration.SPOnlineProvisioning.RestrictedSiteCreationMode |
| 111 | +Parameter Sets: (All) |
| 112 | +Aliases: |
| 113 | +Accepted values: Deny, Allow |
| 114 | + |
| 115 | +Required: False |
| 116 | +Position: Named |
| 117 | +Default value: None |
| 118 | +Accept pipeline input: False |
| 119 | +Accept wildcard characters: False |
| 120 | +``` |
| 121 | +
|
| 122 | +### -RestrictedSiteCreationApps |
| 123 | +
|
| 124 | +> Applicable: SharePoint Online |
| 125 | +
|
| 126 | +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. |
| 127 | +Set to the empty string `""` to clear the policy for a site type. |
| 128 | + |
| 129 | +```yaml |
| 130 | +Type: System.String |
| 131 | +Parameter Sets: (All) |
| 132 | +Aliases: |
| 133 | +
|
| 134 | +Required: False |
| 135 | +Position: Named |
| 136 | +Default value: None |
| 137 | +Accept pipeline input: False |
| 138 | +Accept wildcard characters: False |
| 139 | +``` |
| 140 | + |
| 141 | +### -SiteType |
| 142 | + |
| 143 | +> Applicable: SharePoint Online |
| 144 | + |
| 145 | +When paired with the `–RestrictedSiteCreationApps` parameter, creates a new policy which applies to the specified types of sites. |
| 146 | + |
| 147 | +PARAMVALUE: All | SharePoint | OneDrive | Team | Communication |
| 148 | +- All - OneDrive and all SharePoint sites |
| 149 | +- SharePoint - All SharePoint sites (but not OneDrive) |
| 150 | +- OneDrive - Only OneDrive |
| 151 | +- Team - Only SharePoint team sites (group-connected and classic) |
| 152 | +- Communication - Only SharePoint communication sites |
| 153 | + |
| 154 | +```yaml |
| 155 | +Type: Microsoft.SharePoint.Administration.SPOnlineProvisioning.RestrictedSiteCreationSiteType |
| 156 | +Parameter Sets: (All) |
| 157 | +Aliases: |
| 158 | +Accepted values: All, SharePoint, OneDrive, Team, Communication |
| 159 | +
|
| 160 | +Required: False |
| 161 | +Position: Named |
| 162 | +Default value: None |
| 163 | +Accept pipeline input: False |
| 164 | +Accept wildcard characters: False |
| 165 | +``` |
| 166 | + |
| 167 | +### -Confirm |
| 168 | +Prompts you for confirmation before running the cmdlet. |
| 169 | + |
| 170 | +```yaml |
| 171 | +Type: System.Management.Automation.SwitchParameter |
| 172 | +Parameter Sets: (All) |
| 173 | +Aliases: cf |
| 174 | +
|
| 175 | +Required: False |
| 176 | +Position: Named |
| 177 | +Default value: None |
| 178 | +Accept pipeline input: False |
| 179 | +Accept wildcard characters: False |
| 180 | +``` |
| 181 | + |
| 182 | +### -WhatIf |
| 183 | +Shows what would happen if the cmdlet runs. |
| 184 | +The cmdlet is not run. |
| 185 | + |
| 186 | +```yaml |
| 187 | +Type: System.Management.Automation.SwitchParameter |
| 188 | +Parameter Sets: (All) |
| 189 | +Aliases: wi |
| 190 | +
|
| 191 | +Required: False |
| 192 | +Position: Named |
| 193 | +Default value: None |
| 194 | +Accept pipeline input: False |
| 195 | +Accept wildcard characters: False |
| 196 | +``` |
| 197 | + |
| 198 | +### CommonParameters |
| 199 | + |
| 200 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
| 201 | + |
| 202 | +## INPUTS |
| 203 | + |
| 204 | +### None |
| 205 | + |
| 206 | +## OUTPUTS |
| 207 | + |
| 208 | +### System.Object |
| 209 | + |
| 210 | +## NOTES |
| 211 | + |
| 212 | +## RELATED LINKS |
| 213 | + |
| 214 | +[Getting started with SharePoint Online Management Shell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online) |
| 215 | + |
| 216 | +[Get-SPORestrictedSiteCreationForApps](Get-SPORestrictedSiteCreationForApps.md) |
0 commit comments