Forum Discussion
Margie Kidd
Aug 15, 2018Copper Contributor
Empty folders in SharePoint
Can anyone tell me how to identify SharePoint folders that have 0 files?
Hi Margie -
There is a column in every library called Folder Child Count and Item Child Count. If you add these columns to a view, you can see which folders contain sub-folders or documents. (Item Child Count is for documents).
Would this help?
Regards,
Tom Castiglia
2 Replies
- spucelik
Microsoft
Margie...here is a PowerShell script that should help.
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue $web = Get-SPWeb http://sharepoint/sitecoll/web $list = $web.Lists["List Name"] foreach($folder in $list.Folders) { if($folder.Folder.SubFolders -eq $null) { Write-Host Empty folder at $folder.Url } } - Tom CastigliaIron Contributor
Hi Margie -
There is a column in every library called Folder Child Count and Item Child Count. If you add these columns to a view, you can see which folders contain sub-folders or documents. (Item Child Count is for documents).
Would this help?
Regards,
Tom Castiglia