+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, setACL how do i do this? in Coding and Web Development; The permissions on these folders are currently set for teachers to have full access (this i want) admins to have ...
  1. #1
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,480
    Thank Post
    351
    Thanked 260 Times in 213 Posts
    Rep Power
    99

    setACL how do i do this?

    The permissions on these folders are currently set for teachers to have full access (this i want) admins to have full access (again correct) and studetns read & execute .....

    What i want to do is remove students from read & execute only on the folder which is named as their username (the 92nsm etc) once the whole students group is removed, add in only the user whos name is on the folder to read and write (NO DELETE!)

    where you can see i have "ocr coursework repositry" under that are 5 folders each named something different, under that are more users sometimes of the same username as in other folders

    Can anyone write me the syntax that would remove the students group from each of the folders currently named the students username and add in the student whos name is on the folder as read, write and execute only? I'm unsure how difficult that is for someone with the knowledge of such things, not used it before myself
    Attached Images Attached Images
    Last edited by mrbios; 13th September 2010 at 09:37 AM.

  2. #2

    Join Date
    Jan 2010
    Posts
    12
    Thank Post
    5
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I started using setACL about 3 years ago, it is a great tool, all the available syntax are listed here: SetACL - Documentation / Command line reference

    Some example syntax that may be of use to you are:

    Removing permissions

    To remove permissions from a folder. Replace C:\folder\folder2 with the location (leaving the " " in tact) and replace User with the username of the user that you want to remove permission(s) for. Then depending on what permission is already set for the user, add the relevant syntax at the end of the command (/write, /read, /read_ex, /list_folder, /change).

    setacl.exe "C:\folder\folder2" /dir /revoke User /write
    setacl.exe "C:\folder\folder2" /dir /revoke User /read
    setacl.exe "C:\folder\folder2" /dir /revoke User /read_ex
    setacl.exe "C:\folder\folder2" /dir /revoke User /list_folder
    setacl.exe "C:\folder\folder2" /dir /revoke User /change



    Adding permissions

    To add permissions to a folder. Replace C:\folder\folder2 with the location (leaving the " " in tact) and replace User with the username of the user that you want to grant permission(s) for. Then depending on the level of permission that you want to grant for the user, use the relevant syntax at the end of the command (/write, /read, /read_ex, /list_folder, /change).

    setacl.exe "C:\folder\folder2" /dir /grant User /write
    setacl.exe "C:\folder\folder2" /dir /grant User /read
    setacl.exe "C:\folder\folder2" /dir /grant User /read_ex
    setacl.exe "C:\folder\folder2" /dir /grant User /list_folder
    setacl.exe "C:\folder\folder2" /dir /grant User /change

    All the commands should be put into batch file, and I usually put a pause command after the first few commands to make sure it is executing correctly - after each command, it will tell you if it has completed successfully or not.

    Before you try to run this on an already existing file structure, try it on a test structure first.

    If you will be using this to make a lot of changes, I would use excel and the CONCATENATE function to assemble the batch file commands, then simply copy it to a notepad file and save it as a .bat.

    Also, you will need to run setacl.exe before you try to execute the batch file, failing to do so, will mean the commands will fail.

    If you require any more help, pleas let me know.

    Matt

SHARE:
+ Post New Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •