Many enterprises will add custom attribute values in SiteCollection for later use, such as the site collection setting attribute value labeling Company location, Department, group, security level and other information, convenient post-statistical classification and other uses. So how to query the value of the property on the site collection. If you need to update and how to do it. This article makes a brief introduction to this.
How to get the Site collection property value: Open the SharePoint Management Shell in Administrator mode and execute the following command to query all the properties of the site collection:
$site =get-spsite "Http://sharepoint.com/sites/sitecollection url"
$site. Rootweb.allproperties
If you want to query a property value you can add a name query for the corresponding property after allproperties, such as execute: $site. RootWeb.AllProperties.Department
It will return only the name and value of department.
How to update a property value:
You can copy directly to a property in the SharePoint Management Shell and perform an update. Like what:
$site. Rootweb.allproperties.department= "HR"
$site. Rootweb.update ()
After execution, the value of this property displays the HR, which can be verified by executing the query above.
Thanks for reading.