Results 1 to 9 of 9

Thread: Reset child permissions / inheritance of folder with script

  1. #1
    Thomas Guest

    Reset child permissions / inheritance of folder with script

    Hello everyone,

    is there any possibility to set inheritance settings with a command line
    tool on windos server 2003?

    I´d like to set de checkbox "Replace permission entries on all child objects
    with entires shown here that apply to child objects" on command line!

    I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with the
    parameters:

    SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"

    But there i get the following error:

    ERROR in command line: Invalid number of entries in parameter for option
    -ace sp
    ecified: i:so!

    Type 'SetACL -help' for help.

    Are there any hints to solve this problem, or is there any tool to fullfit
    our needs?

    Thank you very much!

    Thomas



  2. #2
    Thomas Langer Guest

    Re: Reset child permissions / inheritance of folder with script

    Hi Thomas,

    try xcacls.vbs by Microsoft

    HTH Thomas Langer


    "Thomas" <ts@sbg.at> schrieb im Newsbeitrag news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    > Hello everyone,
    >
    > is there any possibility to set inheritance settings with a command line
    > tool on windos server 2003?
    >
    > I´d like to set de checkbox "Replace permission entries on all child objects
    > with entires shown here that apply to child objects" on command line!
    >
    > I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with the
    > parameters:
    >
    > SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >
    > But there i get the following error:
    >
    > ERROR in command line: Invalid number of entries in parameter for option
    > -ace sp
    > ecified: i:so!
    >
    > Type 'SetACL -help' for help.
    >
    > Are there any hints to solve this problem, or is there any tool to fullfit
    > our needs?
    >
    > Thank you very much!
    >
    > Thomas
    >
    >



  3. #3
    Thomas Guest

    Re: Reset child permissions / inheritance of folder with script

    Hello Thomas,

    thank you very much for your help!

    I´d like to enable inheritance on all child objects of a folder but not on
    the folder itself.

    Therefor i used the following syntax: XCACLS.vbs "path" /F /T /S /SPEC E /I
    ENABLE

    But this operation sets the ACL´s for the "root" folder too!

    Is there any possability to set the permissions for the child objects only?

    Oder das Ganze auf Deutsch :)

    Ich möchte die Berechtigungen nur für Subordner setzen und nicht auf den
    eigentlichen Ordner selbst.

    In XCACLS.vbs gibt es die Option /F für den change aller Files im Ordner -
    OK!

    Die Option /T für traverse - OK!

    Die Option /S für Subfolder - OK!

    und die Option /SPEC E - welche bedeuten sollte nur für Subfolders and
    Files...

    genau hier ist der springende Punkt, da auch die Inheritance auf den
    entsprechenden Ordner gesetzt werden!

    Gibt es eine Möglichkeit die Vererbung nur auf die Subordner zu setzen??

    Vielen Dank

    Thomas

    "Thomas Langer" <tlnospam@langer-online.net> schrieb im Newsbeitrag
    news:OOLXb$HPHHA.4820@TK2MSFTNGP05.phx.gbl...
    > Hi Thomas,
    >
    > try xcacls.vbs by Microsoft
    >
    > HTH Thomas Langer
    >
    >
    > "Thomas" <ts@sbg.at> schrieb im Newsbeitrag
    > news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    >> Hello everyone,
    >>
    >> is there any possibility to set inheritance settings with a command line
    >> tool on windos server 2003?
    >>
    >> I´d like to set de checkbox "Replace permission entries on all child
    >> objects
    >> with entires shown here that apply to child objects" on command line!
    >>
    >> I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with
    >> the
    >> parameters:
    >>
    >> SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >>
    >> But there i get the following error:
    >>
    >> ERROR in command line: Invalid number of entries in parameter for option
    >> -ace sp
    >> ecified: i:so!
    >>
    >> Type 'SetACL -help' for help.
    >>
    >> Are there any hints to solve this problem, or is there any tool to
    >> fullfit
    >> our needs?
    >>
    >> Thank you very much!
    >>
    >> Thomas
    >>
    >>

    >



  4. #4
    Jeffery Hicks Guest

    Re: Reset child permissions / inheritance of folder with script

    On Tue, 23 Jan 2007 10:44:20 +0100, Thomas wrote:

    > Hello Thomas,
    >
    > thank you very much for your help!
    >
    > I´d like to enable inheritance on all child objects of a folder but not on
    > the folder itself.
    >
    > Therefor i used the following syntax: XCACLS.vbs "path" /F /T /S /SPEC E /I
    > ENABLE
    >
    > But this operation sets the ACL´s for the "root" folder too!
    >
    > Is there any possability to set the permissions for the child objects only?
    >
    > Oder das Ganze auf Deutsch :)
    >
    > Ich möchte die Berechtigungen nur für Subordner setzen und nicht auf den
    > eigentlichen Ordner selbst.
    >
    > In XCACLS.vbs gibt es die Option /F für den change aller Files im Ordner -
    > OK!
    >
    > Die Option /T für traverse - OK!
    >
    > Die Option /S für Subfolder - OK!
    >
    > und die Option /SPEC E - welche bedeuten sollte nur für Subfolders and
    > Files...
    >
    > genau hier ist der springende Punkt, da auch die Inheritance auf den
    > entsprechenden Ordner gesetzt werden!
    >
    > Gibt es eine Möglichkeit die Vererbung nur auf die Subordner zu setzen??
    >
    > Vielen Dank
    >
    > Thomas
    >
    > "Thomas Langer" <tlnospam@langer-online.net> schrieb im Newsbeitrag
    > news:OOLXb$HPHHA.4820@TK2MSFTNGP05.phx.gbl...
    >> Hi Thomas,
    >>
    >> try xcacls.vbs by Microsoft
    >>
    >> HTH Thomas Langer
    >>
    >>
    >> "Thomas" <ts@sbg.at> schrieb im Newsbeitrag
    >> news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    >>> Hello everyone,
    >>>
    >>> is there any possibility to set inheritance settings with a command line
    >>> tool on windos server 2003?
    >>>
    >>> I´d like to set de checkbox "Replace permission entries on all child
    >>> objects
    >>> with entires shown here that apply to child objects" on command line!
    >>>
    >>> I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with
    >>> the
    >>> parameters:
    >>>
    >>> SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >>>
    >>> But there i get the following error:
    >>>
    >>> ERROR in command line: Invalid number of entries in parameter for option
    >>> -ace sp
    >>> ecified: i:so!
    >>>
    >>> Type 'SetACL -help' for help.
    >>>
    >>> Are there any hints to solve this problem, or is there any tool to
    >>> fullfit
    >>> our needs?
    >>>
    >>> Thank you very much!
    >>>
    >>> Thomas
    >>>
    >>>

    >>


    I have a script called ResetInheritance in my script library at
    http://www.jdhitsolutions.com/scripts that might help. I strongly encourage
    you to test any solution in a non-production environment. I'm sure you are
    but you'd be surprised how many people try stuff like this on production
    systems without understanding what a script is really doing.
    --
    Jeffery Hicks
    SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
    VBScript & Windows PowerShell Training -
    www.ScriptingTraining.com/classes.asp
    Windows PowerShell? - www.SAPIENPress.com/powershell.asp

    blog: http://blog.SAPIEN.com
    blog: http://jdhitsolutions.blogspot.com

  5. #5
    Thomas Guest

    Re: Reset child permissions / inheritance of folder with script

    Hello Jeffery,

    is there any was to reset the permissions for existing files and folders?

    Thank you very much

    Thomas
    "Jeffery Hicks" <"jhicks[at]SAPIEN.com"> schrieb im Newsbeitrag
    news:rdsjy2786f5b.anr99mvnms9e$.dlg@40tude.net...
    > On Tue, 23 Jan 2007 10:44:20 +0100, Thomas wrote:
    >
    >> Hello Thomas,
    >>
    >> thank you very much for your help!
    >>
    >> I´d like to enable inheritance on all child objects of a folder but not
    >> on
    >> the folder itself.
    >>
    >> Therefor i used the following syntax: XCACLS.vbs "path" /F /T /S /SPEC E
    >> /I
    >> ENABLE
    >>
    >> But this operation sets the ACL´s for the "root" folder too!
    >>
    >> Is there any possability to set the permissions for the child objects
    >> only?
    >>
    >> Oder das Ganze auf Deutsch :)
    >>
    >> Ich möchte die Berechtigungen nur für Subordner setzen und nicht auf den
    >> eigentlichen Ordner selbst.
    >>
    >> In XCACLS.vbs gibt es die Option /F für den change aller Files im
    >> Ordner -
    >> OK!
    >>
    >> Die Option /T für traverse - OK!
    >>
    >> Die Option /S für Subfolder - OK!
    >>
    >> und die Option /SPEC E - welche bedeuten sollte nur für Subfolders and
    >> Files...
    >>
    >> genau hier ist der springende Punkt, da auch die Inheritance auf den
    >> entsprechenden Ordner gesetzt werden!
    >>
    >> Gibt es eine Möglichkeit die Vererbung nur auf die Subordner zu setzen??
    >>
    >> Vielen Dank
    >>
    >> Thomas
    >>
    >> "Thomas Langer" <tlnospam@langer-online.net> schrieb im Newsbeitrag
    >> news:OOLXb$HPHHA.4820@TK2MSFTNGP05.phx.gbl...
    >>> Hi Thomas,
    >>>
    >>> try xcacls.vbs by Microsoft
    >>>
    >>> HTH Thomas Langer
    >>>
    >>>
    >>> "Thomas" <ts@sbg.at> schrieb im Newsbeitrag
    >>> news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    >>>> Hello everyone,
    >>>>
    >>>> is there any possibility to set inheritance settings with a command
    >>>> line
    >>>> tool on windos server 2003?
    >>>>
    >>>> I´d like to set de checkbox "Replace permission entries on all child
    >>>> objects
    >>>> with entires shown here that apply to child objects" on command line!
    >>>>
    >>>> I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with
    >>>> the
    >>>> parameters:
    >>>>
    >>>> SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >>>>
    >>>> But there i get the following error:
    >>>>
    >>>> ERROR in command line: Invalid number of entries in parameter for
    >>>> option
    >>>> -ace sp
    >>>> ecified: i:so!
    >>>>
    >>>> Type 'SetACL -help' for help.
    >>>>
    >>>> Are there any hints to solve this problem, or is there any tool to
    >>>> fullfit
    >>>> our needs?
    >>>>
    >>>> Thank you very much!
    >>>>
    >>>> Thomas
    >>>>
    >>>>
    >>>

    >
    > I have a script called ResetInheritance in my script library at
    > http://www.jdhitsolutions.com/scripts that might help. I strongly
    > encourage
    > you to test any solution in a non-production environment. I'm sure you
    > are
    > but you'd be surprised how many people try stuff like this on production
    > systems without understanding what a script is really doing.
    > --
    > Jeffery Hicks
    > SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
    > VBScript & Windows PowerShell Training -
    > www.ScriptingTraining.com/classes.asp
    > Windows PowerShell? - www.SAPIENPress.com/powershell.asp
    >
    > blog: http://blog.SAPIEN.com
    > blog: http://jdhitsolutions.blogspot.com



  6. #6
    Mike Matheny Guest

    Re: Reset child permissions / inheritance of folder with script

    I'll second xcacls.vbs, but too problems with it - there is an MS executable
    with the same name - BAD BAD, and it takes freaking FOREVER! However, it
    does avoid path length problems because it recursively navigates down into
    each folder structure to apply the permissions.

    --

    Mike Matheny


    "Thomas Langer" <tlnospam@langer-online.net> wrote in message
    news:OOLXb$HPHHA.4820@TK2MSFTNGP05.phx.gbl...
    > Hi Thomas,
    >
    > try xcacls.vbs by Microsoft
    >
    > HTH Thomas Langer
    >
    >
    > "Thomas" <ts@sbg.at> schrieb im Newsbeitrag
    > news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    >> Hello everyone,
    >>
    >> is there any possibility to set inheritance settings with a command line
    >> tool on windos server 2003?
    >>
    >> I´d like to set de checkbox "Replace permission entries on all child
    >> objects
    >> with entires shown here that apply to child objects" on command line!
    >>
    >> I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with
    >> the
    >> parameters:
    >>
    >> SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >>
    >> But there i get the following error:
    >>
    >> ERROR in command line: Invalid number of entries in parameter for option
    >> -ace sp
    >> ecified: i:so!
    >>
    >> Type 'SetACL -help' for help.
    >>
    >> Are there any hints to solve this problem, or is there any tool to
    >> fullfit
    >> our needs?
    >>
    >> Thank you very much!
    >>
    >> Thomas
    >>
    >>

    >




  7. #7
    Thomas Guest

    Re: Reset child permissions / inheritance of folder with script

    Hello Mike,

    i´ve tried to solve the problem with xcalcls.vbs - but as you said the
    performance is more than poor. On a folder with about 50 files and about 50
    MB it takes up to 5 minutes...

    hmmm


    "Mike Matheny" <thomasdotmdotmathenyatnasadotgov> schrieb im Newsbeitrag
    news:egclZp9PHHA.4672@TK2MSFTNGP06.phx.gbl...
    > I'll second xcacls.vbs, but too problems with it - there is an MS
    > executable with the same name - BAD BAD, and it takes freaking FOREVER!
    > However, it does avoid path length problems because it recursively
    > navigates down into each folder structure to apply the permissions.
    >
    > --
    >
    > Mike Matheny
    >
    >
    > "Thomas Langer" <tlnospam@langer-online.net> wrote in message
    > news:OOLXb$HPHHA.4820@TK2MSFTNGP05.phx.gbl...
    >> Hi Thomas,
    >>
    >> try xcacls.vbs by Microsoft
    >>
    >> HTH Thomas Langer
    >>
    >>
    >> "Thomas" <ts@sbg.at> schrieb im Newsbeitrag
    >> news:efiKI46OHHA.3872@TK2MSFTNGP06.phx.gbl...
    >>> Hello everyone,
    >>>
    >>> is there any possibility to set inheritance settings with a command line
    >>> tool on windos server 2003?
    >>>
    >>> I´d like to set de checkbox "Replace permission entries on all child
    >>> objects
    >>> with entires shown here that apply to child objects" on command line!
    >>>
    >>> I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with
    >>> the
    >>> parameters:
    >>>
    >>> SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"
    >>>
    >>> But there i get the following error:
    >>>
    >>> ERROR in command line: Invalid number of entries in parameter for option
    >>> -ace sp
    >>> ecified: i:so!
    >>>
    >>> Type 'SetACL -help' for help.
    >>>
    >>> Are there any hints to solve this problem, or is there any tool to
    >>> fullfit
    >>> our needs?
    >>>
    >>> Thank you very much!
    >>>
    >>> Thomas
    >>>
    >>>

    >>

    >
    >



  8. #8
    Join Date
    Feb 2009
    Posts
    8

    Re: Reset child permissions / inheritance of folder with script

    Quote Originally Posted by Thomas View Post
    Hello everyone,

    I´ve allread tried setacl.exe from http://setacl.sourceforge.net/ with the
    parameters:

    SetACL.exe -on "d:\webs\www.testweb.com" -ot file -actn ace -ace "i:so"

    But there i get the following error...

    Thomas
    (I know this is an old quote, posting for the people Googleing out there.)

    To set owner to "Administrators", stripp all custom file permissions on, and reset inheratance on all of the CONTENTS of a specific folder and leave the ACL on the folder itself untouched use:

    Code:
    set foo=d:\webs\www.testwebs.com
    SetACL.exe -silent -on "%foo%\*" -ot file -actn setprot -rec cont_obj -actn setowner -ownr "n:S-1-5-32-544;s:y" -actn clear -clr "dacl,sacl"

  9. #9
    Join Date
    Feb 2009
    Posts
    8

    Re: Reset child permissions / inheritance of folder with script

    My last post had an incorrect command line, do NOT use it. instead use this modified script.

    Remember: This script sets the owner to Administrators, removes all custom file permissions, and sets the "inherit from parent" flag of the CONTENTS of the directory you set in %foo% without modifying the permissions of %foo%

    Code:
    SET foo=D:\data
    SetACL.exe -silent -on "%foo%\*" -ot file -actn setprot -op "dacl:np;sacl:np" -rec cont_obj -actn setowner -ownr "n:S-1-5-32-544;s:y" -actn clear -clr "dacl,sacl"

Similar Threads

  1. Replies: 4
    Last Post: 01-03-2011, 06:08 AM
  2. how to read inheritance property of folder in vbscript
    By vivekmohan in forum Software Development
    Replies: 3
    Last Post: 29-07-2009, 05:30 PM
  3. how to reset file/folders permissions?
    By CoreTin in forum Windows XP Support
    Replies: 1
    Last Post: 24-05-2008, 06:00 PM
  4. A script to list shares with permissions
    By geniiw in forum Windows Server Help
    Replies: 6
    Last Post: 24-03-2008, 04:07 PM
  5. How to script Share Permissions
    By Steve Furniss in forum Windows Server Help
    Replies: 1
    Last Post: 08-11-2007, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •