Skip to content

Instantly share code, notes, and snippets.

@mdnmdn
Last active August 29, 2015 14:00
Show Gist options
  • Save mdnmdn/11396985 to your computer and use it in GitHub Desktop.
Save mdnmdn/11396985 to your computer and use it in GitHub Desktop.
Manage Sharepoint element property bag from powershell
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$web = Get-SPWeb 'http://win13a/sites/dev'
$web.AllProperties['PropertyName'] = '312'
$web.Update()
$webApp = Get-SPWebApplication 'http://win13a/'
$webApp.Properties['PropertyName'] = '312'
$webApp.Update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment