List SharePoint Folder Hierarchical Structure

I’m in the middle of auditing our massive SharePoint setup and I needed a way to list out in a hierarchical way the sites, sub-sites, libraries etc in an easy manor.

Remember this KISS principal? Keep It Simple Stupid.

I had a duh moment.

Remember the DOS days? Remember the tree command?


Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.


Turns out you can use tree to walk the “tree” of your SP structure to help map it out. Duh.

It works like this:

[code]tree \[/code]

Low and behold you’ll get a nice ASCII formatted list of all the folders and their children. Include the /F option and you get the contents too.

Folder PATH listing

Volume serial number is 0000-0000


├───Sell Sheets
├───Planograms  Retail
│   ├───2014
│   ├───2012
│   ├───2011
│   └───2013
├───Price Tracker
├───Shared Documents
│   ├───User1
│   ├───User2
│   ├───User3

Very useful.

If you pipe the output to a .doc extension, Word will open it in ASCII mode with nice tree like connections just like the old days.

Score 1 for the old tree command.

This is great for audits and for going over the structure. My use is for security but it could be used for anything.

Leave a Reply

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