About Me

My photo
HANUMANGARH, RAJASTHAN, India

Monday, 7 February 2022

Get Folder Permission (ACL)

 $FolderPath = dir -Directory -Path "\\sharefolder\temp" -Recurse -Force

$Report = @()

Foreach ($Folder in $FolderPath) {

    $Acl = Get-Acl -Path $Folder.FullName

    foreach ($Access in $acl.Access)

        {

            $Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD

Group or

User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}

            $Report += New-Object -TypeName PSObject -Property $Properties

        }

}

$Report | Export-Csv -path "C:\ACL.csv"

No comments:

Post a Comment

Export contact from Justdial

  Extract Data From JustDial using Selenium Let us see how to extract data from Justdial using Selenium and Python. Justdial is a company th...