Skip to content

Instantly share code, notes, and snippets.

@tiagoduarte
Created August 29, 2017 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagoduarte/4e5e40bd19c29ed7d16e5412445f09e3 to your computer and use it in GitHub Desktop.
Save tiagoduarte/4e5e40bd19c29ed7d16e5412445f09e3 to your computer and use it in GitHub Desktop.
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