I am trying to capture the shares on a given file server. Then getting the ACL (access control list) from a share (doing this manually atm). Then from that share, getting the get-childitem. Can someone help me consolidate this to one line?
Eventually I will have to dump the output to a CSV.
Get all shares
Get-WmiObject -Class Win32_Share -Computer SERVER01 | FT path, name -AutoSize
Get ACL from a given share
(Get-ACL C:\FileShare\testFolder01).Access
Get-ChildItem from a given share
Get-ChildItem C:\FileShare\testFolder02 -Rec | Select-Object DirectoryName, Name, CreationTime, LastWriteTime, Extension | sort DirectoryName, Name