|
|
@@ -0,0 +1,32 @@
|
|
|
+param(
|
|
|
+ $out="runtime\acl.csv",
|
|
|
+ $base="\\fsch.annax.local\30_Prj"
|
|
|
+)
|
|
|
+
|
|
|
+$ErrorActionPreference = "Stop"
|
|
|
+
|
|
|
+Get-ChildItem $base -Recurse | %{
|
|
|
+ $dir = $_
|
|
|
+ # $dir.FullName | out-host
|
|
|
+ $acl = Get-Acl $dir.FullName
|
|
|
+ # $acl | Out-Host
|
|
|
+ $acl.Access | Where-Object {$_.IsInherited -eq $false} | %{
|
|
|
+ if ($_.IdentityReference.Value -like "ANNAX\*") {
|
|
|
+ $axacl = $_.IdentityReference.Value
|
|
|
+ $wtacl = $null
|
|
|
+ $acl.Access | Where-Object {$_.IsInherited -eq $false -and (($_.IdentityReference.Value -replace "WABTEC\\ANG_") -eq ($axacl -replace "ANNAX\\"))} | %{
|
|
|
+ $wtacl = $_.IdentityReference.Value
|
|
|
+ }
|
|
|
+ if ($null -eq $wtacl) {
|
|
|
+ $dir.FullName | Out-Host
|
|
|
+ $axacl | Out-Host
|
|
|
+ [PSCustomObject]@{
|
|
|
+ dir=$dir.FullName
|
|
|
+ acl=$axacl
|
|
|
+ } | Export-Csv -Append $out
|
|
|
+ } else {
|
|
|
+ # "MATCH" | Out-Host
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|