Scripts Thread, Home Area Permissions in Coding and Web Development; I was just looking through all the permissions for the student home areas and all i can say is that ...
-
19th December 2007, 02:16 PM #1 Home Area Permissions
I was just looking through all the permissions for the student home areas and all i can say is that its a mess! Can i write a batch file to clear what is currently there and then add what i want.
I want Administrators, Student Home Area Viewers, Username to all have Full control and thats it.
This works fine on this years year 7 accounts as the folders were created by the software that i used to create the accounts. Not that i can remember what it was called!!
-
-
IDG Tech News
-
19th December 2007, 02:29 PM #2 Re: Home Area Permissions
2 minute job with CACLS or your tool of choice... If you're happy with batch scripting it's just a for /D %%I in (*) do jobby
-
-
19th December 2007, 02:34 PM #3 Re: Home Area Permissions
I find subinacl better these days incase you run into permission problems actually changing the folders details. I posted an example script recently.
-
-
19th December 2007, 02:59 PM #4 Re: Home Area Permissions
whats the username element in calcs is it %USERNAME% or <USERNAME> or something else?
-
-
19th December 2007, 03:07 PM #5 Re: Home Area Permissions
If you are using a loop such as for /D %%I in (*)
Then you get he username from the folder name.
-
-
19th December 2007, 03:09 PM #6 Re: Home Area Permissions
Ive got this so far how do i put your code together with mine?
Code:
cacls d:\Data\Home\Intake02\* /e /t /g "%USERNAME%":f
-
-
19th December 2007, 03:17 PM #7 Re: Home Area Permissions
Assuming you are running from the root directory of the folders you want to change
Code:
for /D %%i in (*) do (
cacls %%i /T /E /G yourdomain\domain admins:F
cacls %%i /T /E /G yourdomain\%%i:c
cacls %%i /T /E /G fishermore\AreaViewers:c
)
The subinacl equivalent which would sort ownership as well and is less likely to run into problems is :
Code:
for /D %%i in (*) do ( subinacl /file %%i /grant=yourdomain\%%i=C "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=c /setowner=yourdomain\%%i
subinacl /subdirectories %%i\* /grant=yourdomain\%%i=f "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=r /setowner=yourdomain\%%i )
%%i is where the username is stored that it gets from the folder name.
-
3 Thanks to ChrisH:
BenABF (11th June 2009), OverWorked (6th August 2008), projector1 (15th July 2008)
-
15th July 2008, 09:56 PM #8 
Originally Posted by
ChrisH
Assuming you are running from the root directory of the folders you want to change
Code:
for /D %%i in (*) do (
cacls %%i /T /E /G yourdomain\domain admins:F
cacls %%i /T /E /G yourdomain\%%i:c
cacls %%i /T /E /G fishermore\AreaViewers:c
)
The subinacl equivalent which would sort ownership as well and is less likely to run into problems is :
Code:
for /D %%i in (*) do ( subinacl /file %%i /grant=yourdomain\%%i=C "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=c /setowner=yourdomain\%%i
subinacl /subdirectories %%i\* /grant=yourdomain\%%i=f "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=r /setowner=yourdomain\%%i )
%%i is where the username is stored that it gets from the folder name.
just used this
for /D %%i in (*) do ( subinacl /file %%i /grant=yourdomain\%%i=C "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=c /setowner=yourdomain\%%i
ChrisH your a legend, saved me hours of work! Thanks mate!
ChrisH
ChrisH
ChrisH
-
-
18th July 2008, 07:48 AM #9 i did this differently but achived the same result by:
1) going into the root directory (depending on your folder structure, mine are year seperated)
2) do a dir /b >> namesOfStudents.txt
3) for /f %x in (namesOfStudent.txt) DO cacls /e /t /G %x@domain.local:C
This ofcourse only works if the home folders are the same as the username.
-
-
28th August 2009, 10:54 AM #10
- Rep Power
- 0

Originally Posted by
projector1
just used this
for /D %%i in (*) do ( subinacl /file %%i /grant=yourdomain\%%i=C "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=c /setowner=yourdomain\%%i
ChrisH your a legend, saved me hours of work! Thanks mate!

ChrisH

ChrisH

ChrisH

every time i try this it says %%! is unexpected at this time - any ideas??
-
-
31st January 2010, 02:44 PM #11
- Rep Power
- 0

Originally Posted by
ChrisH
Assuming you are running from the root directory of the folders you want to change
Code:
for /D %%i in (*) do (
cacls %%i /T /E /G yourdomain\domain admins:F
cacls %%i /T /E /G yourdomain\%%i:c
cacls %%i /T /E /G fishermore\AreaViewers:c
)
The subinacl equivalent which would sort ownership as well and is less likely to run into problems is :
Code:
for /D %%i in (*) do ( subinacl /file %%i /grant=yourdomain\%%i=C "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=c /setowner=yourdomain\%%i
subinacl /subdirectories %%i\* /grant=yourdomain\%%i=f "/grant=yourdomain\domain admins=f" /grant=yourdomain\AreaViewer=r /setowner=yourdomain\%%i )
%%i is where the username is stored that it gets from the folder name.
Seems interesting, will it work on windows server 2008 SP1.
-
-
18th May 2012, 04:05 PM #12
- Rep Power
- 0
Hi Guys,
I am having the same problem. I want to give users Full Controll to their own home directory folders. The rest of the permisions on the folders are correct and I would like to amend them by giving each users Full control to his/her own folder only. I have tried CAClS but it freezes while Subinacl I can not get it to work. Obviously I am not doing it correctly so I was hoping if someone would be able to help.
I am using Server 2008, I have 1600 home directories in the same location "D\Users\Students\..Home directory share the same name as Student acounts. Any help would be greatly apreciated
-
-
18th May 2012, 04:33 PM #13
- Rep Power
- 0
I have not tried these scripts yet, but last time I needed to fix permissions on home directory's I used wisesofts ntfsfix utility
NTFSFix
-
-
18th May 2012, 05:15 PM #14
- Rep Power
- 0
Hi Dana,
Thanks for your reply. I have tried NTFSFix but it does freeze the explorer everytime it runs.
-
-
18th May 2012, 05:55 PM #15
- Rep Power
- 0
I don't try to do 1600 at once all my students are in folders by year, so i do one year at a time. Since you have so many in one folder I would try asking your script to do a part of them at once.
A-F G-L etc, I don't know about batch, but in Powershell I can do -like a* -or -like b*
Give it a try and let us know how it works.
-
SHARE:
Similar Threads
-
By mac_shinobi in forum Networks
Replies: 24
Last Post: 21st May 2008, 12:36 PM
-
By markcuk in forum How do you do....it?
Replies: 27
Last Post: 25th April 2007, 10:38 AM
-
Replies: 27
Last Post: 25th January 2007, 04:42 PM
-
By crc-ict in forum Windows
Replies: 2
Last Post: 7th December 2006, 09:29 PM
-
By luke213 in forum Windows
Replies: 9
Last Post: 16th June 2006, 09:28 AM
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
-
Forum Rules