Solved

Batch file to extract 'Security' on a Folder

Posted on 2011-09-12
10
380 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 81
Server 2012 management. 5 23
how to Classify of email (pdf attachments) 7 35
Read Only access to a Facebook Profile 9 20
The 21st century solution to antiquated pagers.
How do we balance the user experience (UX) with reasonable security measures? It can be done, if you keep these fundamentals in mind.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
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…

786 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