Stéphane Boisvert
asked on
powershell script to get list of user have acces to folder and sub folder
Hi,
i need to get list off users have an acces to files under folder and subfolders
i have many different access and each of my folders have different security group
i need to get all the users of all groups with the folder name
presently i use this script but i cant get the member of each groups in same time
$OutFile = "C:\temp\Permissions.csv"
$Header = "Folder Path,IdentityReference,Acc essControl Type,IsInh erited,Inh eritanceFl ags,Propag ationFlags "
Add-Content -Value $Header -Path $OutFile
$RootPath = "\\my root folder\"
$Folders = dir $RootPath -recurse | where {$_.psiscontainer -eq $true}
foreach ($Folder in $Folders){
$ACLs = get-acl $Folder.fullname | ForEach-Object { $_.Access }
Foreach ($ACL in $ACLs){
$OutInfo = $Folder.Fullname + "," + $ACL.IdentityReference + "," + $ACL.AccessControlType + "," + $ACL.IsInherited + "," + $ACL.InheritanceFlags + "," + $ACL.PropagationFlags
Add-Content -Value $OutInfo -Path $OutFile
}
}
i need to get list off users have an acces to files under folder and subfolders
i have many different access and each of my folders have different security group
i need to get all the users of all groups with the folder name
presently i use this script but i cant get the member of each groups in same time
$OutFile = "C:\temp\Permissions.csv"
$Header = "Folder Path,IdentityReference,Acc
Add-Content -Value $Header -Path $OutFile
$RootPath = "\\my root folder\"
$Folders = dir $RootPath -recurse | where {$_.psiscontainer -eq $true}
foreach ($Folder in $Folders){
$ACLs = get-acl $Folder.fullname | ForEach-Object { $_.Access }
Foreach ($ACL in $ACLs){
$OutInfo = $Folder.Fullname + "," + $ACL.IdentityReference + "," + $ACL.AccessControlType + "," + $ACL.IsInherited + "," + $ACL.InheritanceFlags + "," + $ACL.PropagationFlags
Add-Content -Value $OutInfo -Path $OutFile
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Dustin for your comment
it work perfectly
it work perfectly
Asker confirmed solution works for them.
https://www.netwrix.com/netwrix_effective_permissions_reporting_tool.html
-Joe