kwizcom banner advertisement

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
  }
}
How to Get All Lists in SharePoint Site using PowerShell? How to Get All Lists in SharePoint Site using PowerShell? Reviewed by Salaudeen Rajack on July 26, 2015 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.