mrbios Posted September 13, 2010 Posted September 13, 2010 (edited) 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 Edited September 13, 2010 by mrbios
mattjones Posted September 19, 2010 Posted September 19, 2010 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now