Hallo Zusammen,
ich möchte in allen Dokumentenbibliotheken nach Docx etc filtern und habe folgendes Script. Leider werden mir alle Items angezeigt, wie setzte ich einen Filter?
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Function GetFiles($Folder)
{
Write-Host "+"$Folder.Name
foreach($file in $Folder.Files)
{
Write-Host "`t" $file.Name
}
#Loop through all subfolders and call the function recursively
foreach ($SubFolder in $Folder.SubFolders)
{
if($SubFolder.Name -ne "Forms")
{
Write-Host "`t" -NoNewline
GetFiles($Subfolder)
}
}
}
#Get the Site collection
$Site= Get-SPSite http://sharepoint.de
#Loop throuh all Sub Sites
foreach($Web in $Site.AllWebs)
{
Write-Host "-----------------------------------------------------"
Write-Host "Site Name: '$($web.Title)' at $($web.URL)"
Write-Host "-----------------------------------------------------"
foreach($list in $Web.Lists)
{
#Filter Doc Libs, Eliminate Hidden ones
if(($List.BaseType -eq "DocumentLibrary") -and ($List.Hidden -eq $false))
{
GetFiles($List.RootFolder)
}
}
}