I was recently tasked with created a comparison script that compares the permissions of two different folders (they have the same content as they were restored to a new storage device.) We just need to make sure that permissions stayed the same. There are hundreds of thousands of folders which is why i want to automate the comparison.
Here is what I have so far.
$ACLone = get-childitem <path> -Recurse | where-object {($.PsIsContainer)} | Get-ACL $ACLtwo = get-childitem <path> -Recurse | where-object {($.PsIsContainer)} | Get-ACL write-host “Compare 1 and 2 ———————-” Compare-Object -referenceobject $ACLone -differenceobject $ACLtwo -Property access -includeequal | select sideindicator -ExpandProperty access | ft
The output shows me the groups and what permissions they have but it leaves out what folder that group has permissions to which is crucial for the number of folder i need to compare against. Is there a simple switch I’m missing? Can it even be done like this or would i try another method?
submitted by /u/el_JEWpacabra
[link] [comments]
The post Folder permissions comparison script appeared first on How to Code .NET.