Wednesday, April 2, 2014

Get SharePoint SubSite List items via PowerShell

If you want to get all items in a specific list in Subsite, PowerShell can help:

Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

$spWeb = Get-SPweb "http://sp/site"

$subsite = $spweb.Webs | where {$_.title -eq "SubSiteName"}
$lists = $subSite.Lists
$mylist = $lists | where {$_.title -eq "ListName"}
$mylist.GetItems() | select name


No comments:

Post a Comment