Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Looking for a script/method for replacing permissions on files

  • 05-07-2007 10:46am
    #1
    Closed Accounts Posts: 2,460 ✭✭✭


    Two of our departments are sharing some files at the moment. However sometimes a buyer may put in a file which is owned by them and therefore is not accessible to our marketing department.

    At the moment when I get a call about this problem I just log on and replace all permissions inside the folder to be owned by everyone. I would like this to be automated as it is a recurring problem.


Comments

  • Registered Users, Registered Users 2 Posts: 7,806 ✭✭✭GerardKeating


    Two of our departments are sharing some files at the moment. However sometimes a buyer may put in a file which is owned by them and therefore is not accessible to our marketing department.

    At the moment when I get a call about this problem I just log on and replace all permissions inside the folder to be owned by everyone. I would like this to be automated as it is a recurring problem.

    Have you looked at Windows PowerShell ?


  • Registered Users, Registered Users 2 Posts: 36 declantm


    If you copy the following code into a new batch file (e.g. Permissions.bat) and execute it, that should do the trick
    @Echo off
    setlocal ENABLEEXTENSIONS
    
     REM Change the FolderName to point to the shared directory:
     set FolderName=c:\test
    
     REM Look for all files in all subfolders
     for /f "delims=" %%f in ('dir /a:-d /b /s "%FolderName%"') do @(
    
      REM edit the ACL for each file and grant Everyone change permissions.
      cacls "%%f" /E /G Everyone:C
    
     )
    endlocal
    

    You will need to change the FolderName variable to point to your shared folder name.
    e.g. if the files are kept in the "c:\Shared files" folder then change the text to "set FolderName=c:\Shared files"


  • Registered Users, Registered Users 2 Posts: 816 ✭✭✭Cryos


    Two of our departments are sharing some files at the moment. However sometimes a buyer may put in a file which is owned by them and therefore is not accessible to our marketing department.

    At the moment when I get a call about this problem I just log on and replace all permissions inside the folder to be owned by everyone. I would like this to be automated as it is a recurring problem.

    Hi workaccount,

    What you could do is the following on the Share (e.g \\fileserver\share)

    set the share permissions to Authenticated Users (change) & Domain Admins (full)

    Then under security depending on what way its set, add the 2 departments groups with change access and make sure all permissions thereafter are inheritable. This then means that anyfiles should be accessable by both departments.

    Be carefull if your in a scenaro where you dont want one department accessing anothers files. You may have to manually set inheritable permissions on child folders.


Advertisement