Jump to content

Recommended Posts

Posted

Hi guys

 

I need to add a new group to have permissions over all the students home areas and every time i try and do it in with the explorer menu thing it just crashes. I know you can do it in a script as i have others that do other things.

 

"for /d %%1 in (*) do echo y|cacls %%1 /t /g %%1:f administrators:f system:f"

 

"

for /d %%1 in (*) do "C:\Program Files\Windows Resource Kits\Tools\subinacl.exe" /subdirectories "D:\Data\Home\Intake02\%%1\*.*" /setowner=mcc\%%1"

 

These are the two that i currently have. I want to add a group called staffviewing to the properties so the ICT staff can view the kids work when they forget to email it to the teacher!! I want the group to have write, modify etc. but not full control.

 

Cheers

 

Dan

Posted

http://www.edugeek.net/index.php?name=Forums&file=viewtopic&t=3203

 

This is a link to another forum thread I put here a while ago, it is designed to copy a file to each folder, however it does most of what you want by giving you the ability to do a task to many folders repetitively.

 

part2.cmd

if %2==bytes GOTO :End
xcacls %1\%2 /P domain\Administrator:F /E /Y /T
xcacls %1\%2 /G domain\%2:F /E /Y /T
xcacls %1\%2 /G domain\Staff:F /E /Y /T
xcacls %1\%2 /G "domain\Domain Admins":F /E /Y /T
:End

 

Explannation of lines

1 - if %2 is blank then quit. %2 will be the name of the folder gathered from script

2 - Replace permissions (thats the /P switch) and give administrator full

3 - Grant access (thats the /g) to domain\%2 therefore the foldername

4 - thats granting access for a group

5 - thats access for a group with a space in the name.

 

 

this is assuming the foldername is the same as the username

for example

 

10203 - owned by user 10203

10204 - owned by user 10204

10205 - owned by user 10205

 

i think i explaned how to use it in the other thread also - any q's post back and ill help - otherwise good luck investigating :D:D

 

fooby

  • Thanks 1
Posted

the script i have posted will give full control - there is little difference between write + modify and full control as far as i have seen.

 

It does seem that the scripts that were first posted seem to do similar to what mine did - but the ones i used are in 2 parts and are good to use for other things.

 

Also takeown.exe (from windows resource kits) is useful for owner things

Posted
here is the bat file i created the other week. any tips on how i could have done it better?

 

I can't remember the switches fro XACLS off hand but you can save yourself alot of typing by using permission inheritance from the TDS folder.

Posted

@DSapseid

 

/P - Wipe existing settings and set what the script says

/G - Add to the existing settings that are already set.

 

Please dont shout if i have these wrong - please check this before using

 

but afaik this is whats what - as i say i use NTFSfix coz shiny GUI's win me over all the time.

 

fooby

Posted

cacls will do most things.

 

a key switch is "/e" - this edits the existing list. eg:

 

cacls d:\home /e /t /g "special group":c

 

will give the group called "special group" change (ie "modify" if you're used to the Windows GUI) permissions on every folder under d:\home. The /t switch says "work down the tree" and the /g means Grant.

 

if you left out the /e then this command would prompt "are you sure" - the correct answer to that is "no" :-) because it will wipe all existing permissions and leave only "special group" with change perms.

 

Dummy folders (or even virtual servers) are great for this sort of thing - you can try it all out without risk of buggering things up!

Posted

fooby

 

can you do me a favour and upload the NTFSfix somewhere as bloody websens blocks all the pages that i try and download it from :evil:

 

Cheers Dan

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...