Sunday, July 26, 2015

How to Get All Lists in SharePoint Site using PowerShell

Get all lists in SharePoint site using PowerShell:
To get all SharePoint lists by using PowerShell, use this script:

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Configuration Variables for Web URL
$WebURL ="https://sharepoint.company.com/"

#Get the site
$Web = Get-SPWeb $WebURL

#Get all sharepoint lists by using powershell 
$ListCollection = $Web.Lists

#sharepoint powershell loop through all lists
Foreach($list in $ListCollection)
{
 #get list details 
 Write-host $List.Title - $list.ItemCount - $List.Author.Name
}

One-Line Script to get all Lists in SharePoint using PowerShell:
(Get-SPweb "https://sharepoint.company.com/").Lists | ForEach-Object { Write-Host $_.Title}

SharePoint PowerShell to get all lists in site collection:
PowerShell to get all lists in site collection
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

#Configuration Variables for Site Collection URL
$SiteURL ="https://sharepoint.company.com/sites/Sales"
$Site = Get-SPSite $SiteURL

#Iterate through each web in the site collection
foreach($Web in $Site.AllWebs)
{
 Write-Host $Web.Url -ForegroundColor DarkRed
 
 #Loop through each List in the site
 foreach($List in $Web.Lists)
 {
  Write-Host $list.Title -ForegroundColor Blue
 }
}



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...