Skip to content

[Feature] Set-ADTItemPermission - Keep inheritance enabled and add only one permission #1358

@nkirchhofer-msf

Description

@nkirchhofer-msf

Summary of the new feature / enhancement

Hi,

I fail to understand why calling Set-ADTItemPermission with the -Permission parameter systematically means that inheritance is disabled on the existing permissions.

Would it be possible to be able to do something like:

Set-ADTItemPermission -Path C:\path\to\folder -User "Authenticated Users" -Permission Modify -Inheritance ObjectInherit,ContainerInherit -Method AddAccessRule

that keeps existing permissions untouched, with inheritance enabled if it was before the call and only add a new one, similar to what this is doing:

$acl = Get-Acl -Path $somePath
$acl.AddAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("Authenticated Users", "Modify", "ContainerInherit,ObjectInherit", "None", "Allow")))
$acl | Set-Acl -Path $somePath

Calling Set-ADTItemPermission -EnableInheritance after Set-ADTItemPermission -Permission unfortunately creates duplicates in permissions (inherited ones + the "converted ones" from the Set-ADTItemPermission -Permission call)

Sorry in advance if I'm missing something important here.

Thanks!

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions