Hi All,
How to quickly check where inheritance is messed up and who has what permission on different level in Folder Structure.
If just want to check on Single file or Folder use the following command
Get-Acl -Path C:\windows | FL Path, AccessToString
For Bulk use this
Now run the following command to get folder path
get-childitem P:\folderName -recurse | foreach {$_.directoryName} | Get-Unique
You can either copy from the console or redirect it to a csv file
get-childitem P:\folderName -recurse | foreach {$_.directoryName} | Get-Unique | Out-File -FilePath P:\Temp\inheritance.txt
Open the File, Add FolderName (can be anything) as header, rename the extension to .csv
Now
import-csv -path P:\temp\inheritance.csv | %{Get-Acl $_.FolderName} | FT Path, AreAccessRuleProtected, AccessToString -Wrap
No comments:
Post a Comment