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
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