Script to check and inventory the shares  that have checkbox unchecked "Include inheritable permission from this object’s parent”

creative555
creative555 used Ask the Experts™
on
Hello,
I am looking for a script to check and inventory the shares  that have checkbox unchecked "Include inheritable permission from this object’s parent” and export the results to csv.

It turns out that we have issues with those folders that don't have that checkbox checked and need have that checkbox checked and propagate permissions from parent.

Please help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
This should get the info you want:

$results = @()
$items = Get-ChildItem c:\test -Recurse

foreach ($item in $items) {
    $acl = Get-Acl $item.FullName
    $results += New-Object -TypeName PSObject -Property @{
        IsInherited = $acl.Access[0].IsInherited
        Path = $item.FullName
    }
}

$results | Export-Csv Inherited.csv -NoTypeInformation;Invoke-Item Inherited.csv

Open in new window


Just be sure to replace the path in bold with the actual top level directory you're iterating through.

Author

Commented:
Great! IT works. IS it possible though it would also verify hidden shares.....I tested the script and it ignores hidden shares....Otherwise it is awesome!!

Author

Commented:
Thank you. THis worked!! I don't need hidden folders.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial