The objective of this one liner is to allow you to enumerate all the shares on a client. Then recurse through the files and folders to get the NTFS permissions on each.
Get-WmiObject Win32_Share | Select-Object –Property Path | Get-ChildItem –recurse | get-acl
To get only directorys:
Get-WmiObject Win32_Share | Select-Object –Property Path | Get-ChildItem –recurse | Where-Object {$_.mode –match “d”} | get-acl
To only get information on files:
Get-WmiObject Win32_Share | Select-Object –Property Path | Get-ChildItem –recurse | Where-Object {$_.mode –notmatch “d”} | get-acl
Comments