How do I use commands to query/change the properties of a SharePoint Site collection?

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.