SHAREPOINT2010 List default View update

Source: Internet
Author: User

SHAREPOINT2010 list default View Update 1, Introduction

It's convenient to manage SharePoint projects with a cmdlet script, but it's a lot of effort to write to me with less contact with scripting languages. The requirements are managed by the SharePoint development Portal, where the customer asks for a document with a default view of 15 articles per page, and a picture library showing 12 per page. Because there are many sites, subsites, and libraries created. If one changes that very easy to miss to touch a library, and maybe another day and mood is not happy to change the number of bars displayed per page. So write a script and run and solve the problem.

2. Instruction Set Explanation

Here's a simple order for some instructions.

foreach-object{} loops through each item in the preceding collection.

where-object{}; Filters the previous collection, returning the same set

3. Scripts written by yourself

Update document library default view display 15 article

$sites =get-spsite;

$sites | foreach-object{

$webs =$_. Allwebs;

$webs | foreach-object{

$lists =$_. Lists;

$lists = $lists | Where-object{$_. Basetemplate-eq "DocumentLibrary"};

$lists | foreach-object{

$v =$_. DefaultView;

$v. rowlimit=15;

$v. Update ();

Write-host$v.rowlimit;

}

}

}

Update the picture library, the default view shows 12 articles

$sites =get-spsite;

$sites | foreach-object{

$webs =$_. Allwebs;

$webs | foreach-object{

$lists =$_. Lists;

$lists = $lists | Where-object{$_. Basetemplate-eq "Picturelibrary"};

$lists | foreach-object{

$l

$v =$_. DefaultView;

$v. rowlimit=12;

$v. Update ();

Write-host$v.rowlimit;

}

}

}

Summarize:

Nearly 1 months have not written a blog, in one months have been busy SharePoint projects, self-feeling actually more things to see, SharePoint is only a wide range of knowledge is not difficult.

SHAREPOINT2010 List default View update

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.