Forum Discussion
suren424
Oct 11, 2020Copper Contributor
Getting a parent's parent for a folder using power shell
Hi, I am using a powershell script to enable inheritance for the folders created in NTFS share. In this script, i am getting the folder created for the user by passing a dynamic value and then ...
- Oct 17, 2020
the script seems to be working,
I try it on my side and the result was correct, good job.
$Permission.SetAccessRuleProtection($False,$true) Set-Acl -Path $allFolders.FullName -AclObject $Permission
In the first line and as the $Permission is holding the folder ACL information, there is one of the methods called SetAccessRuleProtection, you can find all other methods and properties by using $Permission | Get-Member.
The SetAccessRuleProtection accepts 2 input IsProtected and PreservedInheritance
SetAccessRuleProtection (bool isProtected, bool preserveInheritance);
IsProtected: Type is Bool ($True/$false) , $False= Enable Inheritance
PreservedInheritance : This parameter is actually ignored as the IsProtected is set to false
Thanks
-------------------------
Feel free to respond and request more information, if you find the answer that satisfy your need, Please make sure to mark it as Best Response and like the other.
farismalaeb
Oct 21, 2020Steel Contributor
Hi, Any update on the case, if its OK and no more input is require please select the best response
- suren424Oct 28, 2020Copper Contributor
Thank youfarismalaeb and Wesley Baker for your inputs and guidance.
Appreciate all your help and support.