GroupType Private
GroupId 9421c7ba-d9a6-4fa8-8fde-b726055f267c
string siteUrl = "https://tenant-name.sharepoint.com/sites/internal";
var authManager = new OfficeDevPnP.Core.AuthenticationManager();
ClientContext ctx = authManager.GetWebLoginClientContext(siteUrl);
Web w = ctx.Web;
w.SetPropertyBagValue("customSiteType", "ProjectSpace");
w.AddIndexedPropertyBagKey("customSiteType");
ctx.ExecuteQuery();
Connect-PnPOnline -Url $siteUrl
Set-PnPPropertyBagValue -Key "customSiteType" -Value "ProjectSpace" -Indexed
ClientContext ctx = authManager.GetWebLoginClientContext("provide the tenant admin url");
Microsoft.Online.SharePoint.TenantAdministration.Tenant tenant = new Microsoft.Online.SharePoint.TenantAdministration.Tenant(ctx);
// Set false to enable custom scripts
// Set true to disable custom scripts
tenant.SetSiteProperties(siteUrl, noScriptSite: false);
Connect-PnPOnline -Url "https://tenantname-admin.sharepoint.com"
$site = Get-PnPTenantSite "https://tenantname.sharepoint.com/sites/internal" -Detailed
# Disabled - Allows Custom Script
# Enabled - Does not allow custom script
$site.DenyAddAndCustomizePages = "Disabled"
$site.Update()
Invoke-PnPQuery
Request-PnPReIndexWeb