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:

tree \sp.company.comsitename

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

\SP.COMPANY.COMSALES.

├───Sell Sheets
├───FM
├───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.

Advertisements

Author: Helicopter Jeff

I'm a vinyl decal cutting and designing, Astrophotography and general photography capturing, RC helicopter/quad copter pilot, Arduino and Raspberry Pi hardware/software developer, network, scripting and troubleshooting ninja living in the metro NY area. I am passionate about my hobbies so much I do them for a living. There's nothing better than getting paid to do what you love.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s