- Newest
- Most votes
- Most comments
Hello,
As you may already aware, to set new Windows access rules using PowerShell, you would need to get the ACL for specified folder/file using Get-Acl and then use Set-Acl.
There doesn't seem to be a native PowerShell command to manage Inheritance and Propagation. You would want to use preserveInheritance and isProtected .NET class parameters to manage permissions with the inheritance. here is an example. Further, you can use these .NET methods 1 and 2 to manage the Container, Object Inheritance and propagation. For example, $inheritpermissions = [system.security.accesscontrol.InheritanceFlags]"ContainerInherit"
.
To reset the ACLs, you can add your user to admin user list on the SMB file share. Then, with that user, you can take ownership of the file/folder using SetOwner and then change the permissions. You may also look into using takeown command.
Relevant content
- asked 3 years ago
- asked 6 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 6 months ago