Hope this will find an answer and will be useful for somebody else looking for the same solution.
I have identified the following list types and their respective BaseTemplates (see text in quotes) as those type of lists where users can upload files to:
- Documents Library: "DocumentLibrary"
- Asset Library: "851"
- Report Library: "433"
- Picture Library: "109"
My code reflects the definitions above:
$siteURL = "http://yoursite"
$site = new-object Microsoft.Sharepoint.SPSite($siteURL)
$webApp = $site.WebApplication
$allSites = $webApp.Sites
foreach ($site in $allSites)
{
$allWebs = $site.AllWebs
foreach ($web in $allWebs)
{
$lists = $web.Lists
foreach($list in $lists)
{
#Getting the base template of each list found
$ListBaseTemplate = $list.BaseTemplate
#Filtering lists where users can upload files to
if($ListBaseTemplate = "DocumentLibrary" -or $ListBaseTemplate = "851" -or $ListBaseTemplate = "433" -or $ListBaseTemplate = "109")
{
#I think I am not missing any uploaded file to our SharePoint
foreach ($item in $list.items)
{
#Getting file properties
}
}
}
}
}
My question is if this code could miss files uploaded to SharePoint 2010
Aucun commentaire:
Enregistrer un commentaire