Quantcast
Channel: SharePoint Diary
Viewing all articles
Browse latest Browse all 1058

Reset SharePoint List View Filters with PowerShell

$
0
0
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 = "http://sales.crescent.com"
$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>"
$View.Update()
$List.Update()
This script removes Sorting and Filters applied to the given SharePoint list view.

Viewing all articles
Browse latest Browse all 1058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>