Property bags in SharePoint is one of few less talked topics in the SharePoint Space. In this blog, I will explain what property bag are, and what is it main usage in SharePoint environment.
Property Bag: As it name suggests, it is just a container to hold the property values. It is used to store configuration data in the sharepoint space. And we can store properties at the following levels:
- Farm (SPFarm )
- Web application (SPWebApplication )
- Site collection (SPSite )
- Site (SPWeb )
- List (SPList )
This is something like app.config information in Microsoft ASP.NET. Property Bags can be edited, created and deleted at all level.
Here, I have a given a example to create a Property bag at the Web Application level.
- $WebUrl = "http://mySites/sites/ "
-
- $web = Get-SPWeb $WebUrl
-
- $web.Properties ["MyNewProperty"] = "New value"
Happy SharePointing :-)