Filtering out lists that are not SharePoint libraries Filtering out lists that are not SharePoint libraries
Arpit Patel

Arpit Patel

October 07, 2014

All Post
img
Share:

The best way to filter out SharePoint lists when iterating the collection of lists is by Template ID.  However it’s not that easy to get the template ID.  Interestingly, GUIDs are somewhat less than random when generated by Microsoft for their internal products. For example, the Feature ID GUID’s last 3 digits is actually the Template ID:

$GUID = $list.TemplateFeatureId.ToString()
$TemplateID = $GUID.substring($guid.length-3)
if ($TemplateID -ne "101")
{
write-host "skipping non-DocLib List $($list.title)"
continue;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to talk?

Drop us a line. We are here to answer your questions 24*7.