Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Get permissions for folders in current directory (add -recurse if desired) and see if any have write access for group names matching users or everyone
- ls -force |where attributes -match 'directory' -PipelineVariable dir|% { (get-acl $dir.FullName).Access|where { $_.AccessControlType -eq 'allow' -and $_.IdentityReference -match 'users|everyone' -and $_.FileSystemRights -match 'write|full' }|select @{n='Writable Directory';e={$dir.FullName}},*}|ft
Advertisement
Add Comment
Please, Sign In to add comment