Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set unique permissions on multiple folders 2

Status
Not open for further replies.

TheGrandHooHa

Technical User
Feb 17, 2002
26
0
0
US
Recently, we moved our user's data folders (students, faculty, and admin at a local school district) to a new server and had to re-create all the user folders. Our file structure is, basically, this:
Code:
Users
  Faculty
  --jdoe
  --gdoe
  Students
  --fdoe
  --rdoe
  Staff
  --adoe
  --zdoe

I need some way to, en masse, go through and provide read and write permissions to the folders. They inherit permissions for DOMAIN\Administrators, but on each user's folder, I need to have that particular user have read and write permissions. (I.E., the user 'adoe' should have R+W access to the 'adoe' folder, along with the administrators whose access is inherited). CACLS doesn't help, because I have to type in each user's name and folder name by hand. Selecting multiple folders does not work also, because it still requires touching each folder.

There are over 2000 of these folders, so I need a script or a nice program that can do this.

Any suggestions?
 
Is this just an ordinary move from one server to a new server with the same permissions? If that is the case, you will solve your problem by backing up your folders from the old server and run a recover of the backup job on the new server.
 
We use a product called Security Copy from a company called Script Logic: Security Explorer is a great asset as well.
With Copy you can move files and folders between NTFS volumes without losing permissions.
With Explorer you can backup restore make changes to and many other thigns to remote server security and share permissions.
Excellent Products.
 
Run a batch file similar to below:

Code:
cd \users\faculty
For /F %%a in ('dir /ad /b') do (
    cacls %%a /T /E /C /G yourdomain\%%a:F
    )
cd \users\students
For /F %%a in ('dir /ad /b') do (
    cacls %%a /T /E /C /G yourdomain\%%a:F
    )
cd \users\staff
For /F %%a in ('dir /ad /b') do (
    cacls %%a /T /E /C /G yourdomain\%%a:F
    )

In this script, the "For" command parses a "dir" command and then uses the folder names (%%a) in the "cacls" command.

This script assumes that the user's logon name in AD is the same as the folder that you are setting permissions on. This will give the user "Full" control on his or her own folder and all subfolders and files.

The cacls command is included with Windows 2003.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Run a batch file similar to below:


CODE
cd \users\faculty
For /F %%a in ('dir /ad /b') do (
cacls %%a /T /E /C /G yourdomain\%%a:F
)
cd \users\students
For /F %%a in ('dir /ad /b') do (
cacls %%a /T /E /C /G yourdomain\%%a:F
)
cd \users\staff
For /F %%a in ('dir /ad /b') do (
cacls %%a /T /E /C /G yourdomain\%%a:F
)

In this script, the "For" command parses a "dir" command and then uses the folder names (%%a) in the "cacls" command.

This script assumes that the user's logon name in AD is the same as the folder that you are setting permissions on. This will give the user "Full" control on his or her own folder and all subfolders and files.

The cacls command is included with Windows 2003.
PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers"
This kind of scripting is what script logic puts at your finger tips in thier GUI.
Great help with the cacls command.
Thanks PSC.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top