Inheritance 如何区分新授予的权限和删除继承后复制的权限?

Inheritance 如何区分新授予的权限和删除继承后复制的权限?,inheritance,powershell,permissions,acl,Inheritance,Powershell,Permissions,Acl,我找到了下面的脚本,它对我很有帮助。 此脚本使用给定根路径中每个用户的权限创建CSV文件。 如果此路径的子项具有权限更改,则脚本也会创建记录。 不幸的是,我不知道如何区分继承和用户或组的新权限。CSV文件中的两个记录看起来相同 function Get-PathPermissions { param ( [Parameter(Mandatory=$true)] [System.String]${Path} ) begin { $root = Get-Item $Path

我找到了下面的脚本,它对我很有帮助。 此脚本使用给定根路径中每个用户的权限创建CSV文件。 如果此路径的子项具有权限更改,则脚本也会创建记录。 不幸的是,我不知道如何区分继承和用户或组的新权限。CSV文件中的两个记录看起来相同

function Get-PathPermissions {
  param ( [Parameter(Mandatory=$true)] [System.String]${Path} )

  begin {
    $root = Get-Item $Path
    ($root | get-acl).Access | Add-Member -MemberType NoteProperty -Name "Path" -Value $($root.fullname).ToString() -PassThru
  }

  process {
    $containers = Get-ChildItem -path $Path -recurse | ? {$_.psIscontainer -eq $true}
    if ($containers -eq $null) {break}
    foreach ($container in $containers)
    {
      (Get-ACL $container.fullname).Access | ? { $_.IsInherited -eq $false } | Add- ember -MemberType NoteProperty -Name "Path" -Value $($container.fullname).ToString() -PassThru
    }
  }
}

Get-PathPermissions $arg[0] | Export-Csv $outputFileName -Delimiter ";"

有人知道如何解决我的问题吗?

我认为您必须将“未继承”文件夹的访问值与其父文件夹进行比较…@Kayasax是正确的。删除继承时添加的ACE和手动添加的ACE在技术上没有区别。