Windows Server 2008 R2 Thread, Folder Permissions Question in Technical; Spend the time to figure this out with the DOS FOR command and the ICACLS command. YOU CAN DO IT!
1st February 2013, 10:34 PM #16
- Rep Power
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.
Last edited by jklight; 1st February 2013 at 10:40 PM.
Thanks to jklight from:
TheScarfedOne (3rd February 2013)
IDG Tech News
3rd February 2013, 02:31 PM #17
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.
3rd February 2013, 03:03 PM #18
Personal opinion, SetACL is easier to use.
Originally Posted by Darylrese
By WiPPaH in forum Windows Server 2000/2003
Last Post: 9th February 2010, 05:36 PM
By tickmike in forum *nix
Last Post: 12th January 2007, 10:26 PM
By wesleyw in forum Windows
Last Post: 9th January 2007, 09:25 PM
By ajbritton in forum ICT KS3 SATS Tests
Last Post: 18th December 2006, 12:09 PM
Last Post: 12th October 2006, 10:37 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)