import-module Ntfssecurity $lokatie = "\Domain.localdfs" $header = "Fullname;InheritanceEnabled" $CSV = "C:file.csv" add-content -value $header -path $CSV $list = Get-Childitem $lokatie -recurse | where {$_.psiscontainer -eq $true} foreach ($Item in $list){ $export = get-inheritance -path $item.fullname foreach ($object in $export){ $outinfo = $item.fullname + ";" + $object.inheritanceEnabled add-content -value $outinfo -path $CSV}}
—