Last active
December 24, 2015 17:29
-
-
Save devendrasv/6836194 to your computer and use it in GitHub Desktop.
Get all document libraries in a site collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load powershell snapin | |
Add-PSSnapin "Microsoft.SharePoint.PowerShell" | |
#Get site collection details | |
$s = Get-SPSite http://spjourney | |
#Get all web sites in the site collections | |
$wc = $s.AllWebs | |
foreach($w in $wc) | |
{ | |
#loopthrouh the lists and libraries in the site | |
foreach($l in $w.Lists) | |
{ | |
#Check for only document libraries | |
if($l.BaseTemplate -eq "DocumentLibrary") | |
{ | |
Write-Host $l.Title"(Web: "$w.Title")" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment