Solved

Batch file to extract 'Security' on a Folder

Posted on 2011-09-12
10
378 Views
Last Modified: 2012-05-12
Hi Guys,

I need some help with extracting the 'Security' information on a Shared folder.

So I need a script which extracts:

1. Security Groups on the Folder
2. In addition, the members of the concerned groups.

Cheers.
0
Comment
Question by:japitsolution
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 3

Expert Comment

by:tumtum73
ID: 36528455
You'll want to use a tool called SubInACL (link below).

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23510

You type the following command to extract the permissions for the entire C: drive toa file called perms.txt:

subinacl /noverbose /output=c:\perms.txt /subdirectories c:\*.*

If you find later that permissions have been changed and you want to change them back, you can type:

setacl /playfile c:\perms.txt

and the process will attempt to set them back.
0
 
LVL 3

Expert Comment

by:tumtum73
ID: 36528458
the second command should be:

subinacl /playfile c:\perms.txt
0
 

Author Comment

by:japitsolution
ID: 36532845
Well I prefer either an portable tool or a command base script. I cannot make the below changes on the server:

1. Install a Program
2. Make changes to permissions/security on a folder.

Hence the above solution is not appropriate.

Any other suggestions?
0
 
LVL 4

Expert Comment

by:artsec
ID: 36533465
Hello, you can use CACLS command to display or modify Access Control Lists (ACLs) for files and folders. ACL determines which users (or groups of users) can read or edit the file.

In the new version of Windows (Windows 7 and Windows 2008 Server) there is a similar utility for command prompt which is "ICACLS".

The usage is easy as follow:

cacls C:\users\johns
icacls C:\users\johns\test.txt

you can save the output in a file as well with following argument:

> filename.txt

Examples:

cacls C:\users\johns > filename.txt
icacls C:\users\johns\test.txt > filename.txt

All the best,



0
 

Author Comment

by:japitsolution
ID: 36818553
Well I prefer either an portable tool or a command base script. I cannot make the below changes on the server:

1. Install a Program
2. Make changes to permissions/security on a folder.

Hence the above solution is not appropriate.

Any other suggestions?
0
New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

 
LVL 4

Expert Comment

by:artsec
ID: 36818932
Hi,

Did you check my solution?  It is windows command prompt utility and you can make a batch  file easily. You do not need to change any permissions or install an application.

Thanks,
Ali
0
 

Author Comment

by:japitsolution
ID: 36952337
Hi Artsec/Ali,

Your solution is impressive however what I initially requested was a Tool/Batch file which can extract this information.

Are you able to prepare a Batchfile for me Please?

Thank you.
0
 
LVL 5

Accepted Solution

by:
mlchelp earned 500 total points
ID: 36977395
try this, paste it into notepad and then save it as something.bat maybe permissions.bat or what ever you want, it will prompt you for the folder enter c:\windows or what ever folder you are using, then it will display the users and groups with permision to the folder then it will prompt you for a groupname and then display the members of the group.


set /p folderin=Please enter folder path, IE C:/windows:
icacls %folderin%
set /p groupin=Please enter group:
net group "%groupin" /domain


Have fun

Mike
0
 
LVL 5

Expert Comment

by:mlchelp
ID: 36977415
If you have enough disk space run multiple versions of windows 7 each with a different version of sql installed and then select wich ever one you want at startup via the boot.ini
0
 

Author Closing Comment

by:japitsolution
ID: 36982721
Fantastic Solution Mike.

It worked like a treat
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Encryption for Business Encryption (https://en.wikipedia.org/wiki/Encryption) ensures the safety of our data when sending emails. In most cases, to read an encrypted email you must enter a secret key that will enable you to decrypt the email. T…
Three simple tips to quickly and efficiently back up and protect the contents of your PC and Mac®.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now