Wednesday 6 November 2013

Enable/Disable Delete Option of List in Sharepoint 2010 using Powershell

Share it Please
Script:-

If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell
}

$web = Get-SPWeb -Identity "http://ABCD:12312/sites/Sample/" -AssignmentCollection $assignment
$list = $web.lists["TestList1"]
$list.AllowDeletion = $false
$list.Update()


Note:-

 http://ABCD:12312/sites/Sample/ = site collection url
TestList1 = List Name

No comments:

Post a Comment

Followers

Follow The Author