Delete a particular view for the specified SharePoint 2010 list using web service in powershell

Steps Involved:

  1. Open SharePoint 2010 Management Shell by going to Start | All Programs | SharePoint | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell (Run as Administrator).
  2. Run the following script.

Powershell Script:

 
## Delete a particular view for the specified SharePoint 2010 list using web service in powershell
## Web Service Reference - http://Site/_vti_bin/Views.asmx
$uri="http://serverName:10736/sites/ECT/_vti_bin/Views.asmx?wsdl"
## $listName is the string that contains the list name from which a particular view has to be deleted
[
String]$listName="List"
## $viewName is the string that contains the GUID of the view that has to be deleted
[
String]$viewName="7F863D23-695D-42C4-AC0D-93391F5E3FCE"
$viewsWebServiceReference = New-WebServiceProxy -Uri $uri -UseDefaultCredential
Write-Host -ForegroundColor Magenta "Deleting the view ............"
$viewsWebServiceReference.DeleteView($listName,$viewName)


Ebook Download
View all
Learn
View all