Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SharePoint Designer in Office 365
#params
$username = "admin@contoso.onmicrosoft.com"
$password = "myPWD"
$url = "https://contoso.sharepoint.com"
$adminUrl = "https://contoso-admin.sharepoint.com"
$spd = 0#0-deny disabled; 1-deny enabled
#connect to SPO
$securePassword = ConvertTo-SecureString $password -AsPlainText -force
$credential = New-Object System.Management.Automation.PsCredential($username, $securePassword)
Connect-SPOService -Url $adminUrl -Credential $credential
#enable SPD
write-host ("SharePoint Designer Protection: " +(Get-SPOsite $url).DenyAddAndCustomizePages)
Set-SPOsite $url -DenyAddAndCustomizePages $spd
write-host ("SharePoint Designer Protection: " +(Get-SPOsite $url).DenyAddAndCustomizePages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment