Sunday, July 14, 2013

How get SharePoint Lists or Library using PowerShell

PowerShell command to get reference a website

$web = Get-SPWeb http://myServerUrl

PowerShell command to get List or Library

$web = Get-SPWeb http://myServerUrl
$list= $web.Lists["Your List or Library Name"]

PowerShell command to delete a list or library from SharePoint 2010

$web = Get-SPWeb http://myServerUrl
$list= $web.Lists["Your List or Library Name"]
$list.Delete()

Note: Allow delete is if not allowed on List or Library

$web = Get-SPWeb http://myServerUrl
$list= $web.lists["Your List or Library Name"]
$list.AllowDeletion = $True

$list.Update()

No comments:

Post a Comment