Hi,
I need to get a list of all the catalogs in a site collection in PowerShell. Anyone know how to do this?
Thanks,
-Haniel
Thanks Henry. We ended up taking a different approach on this.
Regards,
-Haniel
Hi,
Something like the below should do the trick, just replace “http://prodcat” with the URL of your site collection.
add-pssnapin microsoft.sharepoint.powershell
$sc = get-spsite http://prodcat
$webs = $sc.AllWebs
$lists = foreach ($web in $webs) {$web.lists}
$libraries = foreach ($list in $lists) {$list | where {$_.IndexedRootFolderPropertyKeys.Contains(“IsPublishingCatalog”)}}
$libraries | select title
I would think that it isn’t too hard to achieve what you after. I will have a crack at it on Monday when I will have access to my environment if nobody has replied before then.