Filtering out lists that are not SharePoint libraries

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)"
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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