How to Produce a Document of Folder Structure of Data Server

Associate
Joined
22 Mar 2012
Posts
1,161
Hi Guys,

One of our customer has asked us to produce a report detailing the folder structure of their data server so that they can review it and then hopefully tidy it up.

As much as I would love to do this manually :eek: I am hoping someone can point me in the direction of some software that will do this for me.

I used Treesize and then exported it but the results weren't particularly clear and made for a 1300 page document:D

They haven't asked for it yet but I can also see them asking us to detail the permissions for each folder as well. So if anyone has any suggestions on this they would also be appreciated :D
 
Do you know what format you want the results displayed as? Should be fairly easy to do a script that would output details (depending on how you would want it displayed!) What platform is the server? Win or *nix? Is it multiple drives that you want reported on?
 
I wrote a powershell script to do this, ended up identifying around 10,000,000 folders. You can get folder permissions this way too.

As for permissions, this will depend on if they want to keep the structure or not. I'd suggest that if they want wholesale permissions changes you create a new structure and move the files between the two. Failing that, come up with a manageable group structure for read/write, read only and traverse/list and populate those groups appropriately. I'm guessing that a 1300 page document means you have a reasonable number of users here so its very much a case of identifying someone in the business that wants to help facilitate change (for the better) and getting that person or group of people to do a lot of the legwork for you.

When you're done, write a solid document for your helpdesk team to follow or it'll have gone to **** in a week.
 
GetFolderSize is pretty basic, but free, allows you to scan network drives, and comes in a portable flavour so you can just run it off a USB stick - I've pretty much sacked off treesize in favour of it.
The reports are very basic, and export to a csv, so you might have to do some work in the spreadsheet app of your choice to pretty it up. But you can limit it to a certain number of folder levels which may be useful. But it also won't help with the permissions side.

Having said all that, the paid version of Treesize probably does the same, and will do the permissions too, so you might be worth paying out some cash if you haven't already and give the pro version a try.

I think what you want, and I want it now too. Is an offline version of treesize, that you can load in an export of your scan for them to look at interactively.
 
Do you know what format you want the results displayed as? Should be fairly easy to do a script that would output details (depending on how you would want it displayed!) What platform is the server? Win or *nix? Is it multiple drives that you want reported on?

I wrote a powershell script to do this, ended up identifying around 10,000,000 folders. You can get folder permissions this way too.

As for permissions, this will depend on if they want to keep the structure or not. I'd suggest that if they want wholesale permissions changes you create a new structure and move the files between the two. Failing that, come up with a manageable group structure for read/write, read only and traverse/list and populate those groups appropriately. I'm guessing that a 1300 page document means you have a reasonable number of users here so its very much a case of identifying someone in the business that wants to help facilitate change (for the better) and getting that person or group of people to do a lot of the legwork for you.

When you're done, write a solid document for your helpdesk team to follow or it'll have gone to **** in a week.

It's Windows based. Ideally I suppose we would want to output it to a word/pdf document so that the client can read it fairly easily. Something tells me it won't be that simple though. I suspect we'll have to go down the .csv or .txt route and then work from there to make it into a easily readable doc.

Do you guys have an example scripts? I'll then tailor it to the network.
 
If you don't need things like permissions or directory sizes, good old Command Prompt may well do what you need:

Code:
dir /b /s > MyStructure.txt

That lists directories and files in the bare format (/b) recursively (/s) and puts the results into a plain text file called MyDirectories.txt at the location the command is run.
 
get-childitem and get-acl will do all of this for you

(heres a starting point for you get-childitem | get-acl | fl)
 
if you use | export-csv it might be a bit easier to work with for this quantity of folders...
 
use total commander + a packer plugin that outputs to list. No ACL though just files.

http://www.totalcmd.net/plugring/catalogmaker.html

It can do different levels and indent for files but quite basic. I think it basically brings a gui to the dos command dir >


As for cleaning it up. I don't think there is any way to clean up a file structure that is sufficiently complicated without having some kind of knowledge of what needs to be there and what does not. I always find when cleaning up the best way to do it, although basic, ill say anyway. Create a folder in each relevant section called _old or _cleanup and then just move old stuff to the folder. Do not delete the folder and continue to back it up. Then you keep track of the usage of the folders and then if you see usage move that data out. If not after a certain amount of time you move the data to secondary storage and out of the file structure and back it up in a more archival way. If i can avoid it ill always avoid deleting data until i know it has not been requested or claimed for a significant amount of time. Sorry if you already knew that and were not asking for that explanation.

Actually I think DRZ new location is the best solution. Sorry didn't read that first.
 
Last edited:
Back
Top Bottom