Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

win script

Hi

I use Get-ChildItem to display folders in specific path
my question is how i can filter results  to display only folder that has deny access


thanks
0
ang3lus
Asked:
ang3lus
1 Solution
 
Chris DentPowerShell DeveloperCommented:

Depends a bit on what you want to see, but this will do it.
Get-ChildItem | Where-Object { (Get-Acl $_.FullName).Access | Where-Object { $_.AccessControlType -eq 'Deny' } } 

Open in new window

Cheers,

Chris
0
 
ang3lusAuthor Commented:
Thanks
the script work like charm
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now