Question : Set Folder Permissions with xcacls

This is the situation:
I have a directory with 250 directories in it.  Each directory corrosponds to a student's network id.  These are going to be their profiles directory on the server.  I need to set the permissions to Inhereit but also give the user full control to their individual directory. How do I use xcacls to do that? Is there a way to us something like %username% or can I get the name of the folder and us it.  If I have to type each one in I might as well go through the mouse clicks.

Help would be greatly apprecaited.

Answer : Set Folder Permissions with xcacls

Actually looking at here fro the syntax for XCACLS:

http://technet2.microsoft.com/WindowsServer/en/library/8ec308b8-9229-44bb-acad-707ec1b7f0a91033.mspx?mfr=true

it looks pretty well the same.

I normally use subinacl.exe from the resource kit to make the user the owner of the directories too so that  they show up in quotas etc.:

subinacl /noverbose /subdirectories d:\users\user\*.* /setowner=domain\user
subinacl /noverbose /file d:\users\user /setowner=domain\user

which could be incorporated into the script as:

@echo off
for /F "tokens=*" %%f in ('dir D:\users /ad /b') do call :process %%f
goto end

:process
cacls D:\users\%1 /t /e /g:%1:F
subinacl /noverbose /subdirectories d:\users\%1\*.* /setowner=domain\%1
subinacl /noverbose /file d:\users\%1 /setowner=domain\%1

:end
Random Solutions  
 
programming4us programming4us