Wednesday, November 5, 2014

Have you ever needed to present a quick report of a Server's Shares, the Path of each share, and maybe the share permissions assigned to each share?
If that is the case you would probably needed to present it in Excel or similar format.

=================================================================
The output as it can be see is going to be: LISTASHARE.TXT but rename it as .csv if you prefer.
It will get the list of shares from the server, and will obtain the physical path, and the permissions in CSV format so it is importable into excel and do a TEXT TO COLUMNS using semicolons.

What executables or binaries do I need?
sed.exe (and its dependencies 3 .DLLs)
rmtshare.exe (Microsoft tool)

You can get all together including the scripts and an additional script where you just need to fill in specifically a list of shares you want into a file named shares.txt then run otro.cmd
From here: Click here please (it is a link from adfly, just click on the SKIP AD button which will appear after 5 Seconds).

Then you can just click on the file which is hosted on mega.co.nz

Important, the zip file has a password to make sure it was not edited or anything like that:

Password: edu-naka.blogspot.com

In this file: shares-csv.zip you will find:

Content of the Shares-csv.zip

sed.exe and its dependencies 3 DLL files(unix port you may find it http://gnuwin32.sourceforge.net/packages/coreutils.htm)

rmtshare.exe (alternative location you may find it ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/ at least for now)

and Two scripts:

5.cmd: just edit the file and where it says Set Servername=type your server name here and save it. For example Set Servername=FileSERVER1

otro.cmd: for this all what you need to do is to fill in a text file named shares.txt with a list of share (do not leave any space that is not required for example "\\server1\share1 " it should read "\\server1\share1" (without the quotes)).

The result could look similar to this: (open or paste the content of Listashare.txt with excel).

If you use it leave me a comment, tell me if you liked it. Try testing it as much as possible.

And thanks to my collegue friend Seba Bistakis (he gave me a piece of code with sed.exe to avoid using tr.exe).