Advertisement
ajm5k6

Folder Permissions Auditing Script

Mar 27th, 2024
102
0
316 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | Cybersecurity | 0 0
  1. # List of Folders
  2. $Folders =@(
  3. C:\Folder1
  4. C:\Folder2
  5. C:\Folder3
  6. )
  7.  
  8.  
  9. $acl = Get-Acl -Path $Folders
  10.  
  11. $permission = $acl.Access | Where-Object { $_.FileSystemRights -eq "Traverse" -and $_.AccessControlType -eq "Allow" }
  12.  
  13. if ($permission -ne $null) {
  14. Write-Host "Traverse folder / execute file permission is enabled for $($folderPath)"
  15. } else {
  16. Write-Host "Traverse folder / execute file permission is not enabled for $($folderPath)"
  17. }
  18.  
Tags: powershell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement