Thursday, April 16, 2015

Reset SharePoint List View Filters with PowerShell

Requirement: Reset SharePoint view filters.

Solution: To reset SharePoint view in bulk, we can use this PowerShell script.

PowerShell script to reset SharePoint view.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$WebURL = ""
$ListName = "Proposal Documents"
$ViewName = "All Proposals"  
#Get the Site, List and View objects
$web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]
$View = $List.Views | ? {$_.title -eq $ViewName}

#Reset SharePoint View - By default sort by Name
$View.Query = "<OrderBy><FieldRef Name='FileLeafRef' /></OrderBy>" 
This script removes Sorting and Filters applied to the given SharePoint list view.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...