Farm Property Bag
List farm properties | $farm = Get-SPFarm $farm.Properties.GetEnumerator() | Sort Name | fl -Auto or (Get-SPFarm).GetEnumerator() | Sort Name | fl -Auto |
Add a farm property | $farm=Get-SPFarm $farm.Properties.Add("[name]", "[value]") $farm.Update() |
Set a farm property | $farm.Properties["[name]"] = $value $farm.Update() |
Remove a farm property | $farm.Properties.Remove("[name]") $farm.Update() |
References
- Change Farm Level Property Bag using PowerShell
- Powershell to get Property bag for Farm, Web App or Site Collection
- Property Bags in SharePoint 2013 - Store, Retrieve Custom Configurations
- pbs2013, SharePoint Property Bag Settings 2013
- Using SharePoint PropertyBag in the Context of Search
- storing custom objects in sharepoint farm property bags
- Microcode: PowerShell Scripting Tricks: The Joy of using Hashtables with Windows PowerShell
Notes
- Properties are stored in Hash-Table (Key-Value) format.
- Not case-sensitive.
- Same approach is used at the web application, site collection, web and list levels. Each of these has a "Properties" collection. For web application properties, you would use a web application object, for site collections, get an instance of the site collection object, and so on.
- I have found that some SharePoint solution (e.g., farm solution) providers add properties to the farm properties bag for internal sharing of licensing information.
- Properties must be added as key-value pairs.
No comments:
Post a Comment