How to remove properties from multiple places in SharePoint with powershell script?
For Web Application
$web = Get-SPWeb <url>
$web.Properties.Remove('test') // this is a key
$web.Update()
$web.Properties
For Farm
$web = Get-SPFarm
$web.Properties.Remove('test') // this is a key
$web.Update()
$web.Properties
Powershell to get Property bag for Farm, Web App or Site Collection
For Web Application
$web = Get-SPWeb <url>
$web.Properties.Remove('test') // this is a key
$web.Update()
$web.Properties
For Farm
$web = Get-SPFarm
$web.Properties.Remove('test') // this is a key
$web.Update()
$web.Properties
Powershell to get Property bag for Farm, Web App or Site Collection
Instead of $web.Properties.Remove('test'), use allproperties then it will work.
ReplyDeleteso the correct way will be:
$web = Get-SPWeb
$web.AllProperties.Remove('test') // this is a key
$web.Update()
$web.Properties