- 最新
- 投票最多
- 评论最多
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.
相关内容
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前