Deny Folder delete This folder only RRS feed

  • Question

  • Hi, with the below, when I try to access the subfolders, it will not allow me unless I run to replace all child object permission entries with inheritable permission entries from this object on each folder 

    what I am doing wrong, please help

    what I would like to do is: 

    Trying to update and add permission to 1000 folders so the users cant more or delete them, and can have modify & access within the subfolders  The top folder Test will have ready only access, subfolders (New Folders ) will have, modify this folder, subfolder and files on a Security group & Deny Delete on this folder only


    $Group="Data Drive Access"

    $UD = $Domain +"\"+ $Group


    $Group2="Data Drive Access (Deny Delete-Move)"

    $UD2 = $Domain2 +"\"+ $Group2

    #Domain Use format domain\username or domain\group

    # Take Ownership

    takeown  /f  $StartingDir /r


    #Location of Directoy 

    #icacls $StartingDir /grant:r "$($UD):(D)"

    icacls $StartingDir /q /c /t /reset 

    icacls $StartingDir /grant:r "$($UD):(OI)(CI)M"

    icacls $StartingDir /deny "$($UD2):(D)" /t

    icacls $StartingDir /q /c /t

    I have also ported this on spiceworks, as I tried using $acl.SetAccessRule($rule) and  $acl.AddAccessRule($ruleAdd), ran into another problem.  

    o why won't this work 


    • Edited by nrothwell Friday, October 30, 2020 1:38 PM spelling
    Friday, October 30, 2020 1:37 PM

All replies