SOLVED

Empty folders in SharePoint

Copper Contributor

Can anyone tell me how to identify SharePoint folders that have 0 files?

2 Replies
best response confirmed by VI_Migration (Silver Contributor)
Solution

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

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
      }        
    }
1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

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

View solution in original post