Spend the time to figure this out with the DOS FOR command and the ICACLS command. YOU CAN DO IT!
Experiment in a test directory for a while and you will make it work and have a powerful new tool in your belt.
1) in the "for" command the %a is the variable.(could be %b or %c etc) If you run this in a .bat file you will have to use %%a (weird quark)
2) since you borked the permissions you need to do this to reset:
CD /d E:\Homedrives
for /D %a in ("*") do icacls "%~fa" /grant:r "MCA\ICT Teachers File Access":(OI)(CI)(IO)(M) "MCA\%~a":(F) SYSTEM:(F) Administrators:(F) /Inheritance:R /C /Q
This removes inheritance (from E:Homedrives) and explicitly puts then new permissions at the user folder level. These permissions inherit down from there. The "%~fa" is means use the full path name of the directory the "%~a" means just use the folder name (which is the logon name) This assumes that the users folder name is their logon name.
Just to let you know as a quick fix i set the parent permissions on the home driver folder, set everything underneath to inherit then set the user permissions one by one at the user folder level. Next time i will look into doing it with ICACLS.
Personal opinion, SetACL is easier to use.
Originally Posted by Darylrese