+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
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 ...
  1. #1
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38

    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!!

  2. #2

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65

    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

  3. #3
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    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.

  4. #4
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38

    Re: Home Area Permissions

    whats the username element in calcs is it %USERNAME% or <USERNAME> or something else?

  5. #5
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    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.

  6. #6
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38

    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

  7. #7
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    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.

  8. 4 Thanks to ChrisH:

    BenABF (11th June 2009), CharlieGreen (10th June 2012), OverWorked (6th August 2008), projector1 (15th July 2008)

  9. #8
    projector1's Avatar
    Join Date
    Nov 2005
    Posts
    461
    Thank Post
    70
    Thanked 1 Time in 1 Post
    Rep Power
    18
    Quote Originally Posted by ChrisH View Post
    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!
    ChrisHChrisHChrisH

  10. #9
    amfony's Avatar
    Join Date
    Jul 2007
    Location
    Sydney
    Posts
    161
    Thank Post
    29
    Thanked 13 Times in 13 Posts
    Rep Power
    17
    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.

  11. #10

    Join Date
    Aug 2009
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by projector1 View Post
    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!
    ChrisHChrisHChrisH
    every time i try this it says %%! is unexpected at this time - any ideas??

  12. #11

    Join Date
    Jan 2010
    Location
    Jaipur
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by ChrisH View Post
    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.

  13. #12

    Join Date
    Dec 2005
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    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

  14. #13
    ADMaster's Avatar
    Join Date
    May 2012
    Posts
    332
    Thank Post
    5
    Thanked 35 Times in 30 Posts
    Rep Power
    23
    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

  15. #14

    Join Date
    Dec 2005
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Dana,
    Thanks for your reply. I have tried NTFSFix but it does freeze the explorer everytime it runs.

  16. #15
    ADMaster's Avatar
    Join Date
    May 2012
    Posts
    332
    Thank Post
    5
    Thanked 35 Times in 30 Posts
    Rep Power
    23
    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:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Transfer User Area's - Permissions Issues ??
    By mac_shinobi in forum Wireless Networks
    Replies: 24
    Last Post: 21st May 2008, 12:36 PM
  2. delete same folder from all users home area
    By markcuk in forum How do you do....it?
    Replies: 27
    Last Post: 25th April 2007, 10:38 AM
  3. Replies: 27
    Last Post: 25th January 2007, 03:42 PM
  4. Advanced file permissions in XP Home
    By crc-ict in forum Windows
    Replies: 2
    Last Post: 7th December 2006, 08:29 PM
  5. 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
  •