Created
June 19, 2014 00:15
-
-
Save Greyeye/d6ceee99c04796bdc288 to your computer and use it in GitHub Desktop.
get custom non inherited permission for a target folder/path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory = $true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$targetPath | |
) | |
$SharedFolders = get-childitem -recurse -path $targetPath |where {$_.Attributes -eq 'Directory'} | |
foreach($SharedFolder in $SharedFolders) | |
{ | |
foreach ($access in $sharedFolder.getAccessControl().Access){ | |
if ($access.isinherited -eq $false) | |
{write-host "Path is " $sharedfolder.fullname -ForegroundColor "red" | |
$access} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment