powershell - combining get-wmiobject, get-acl and get-childitem -


i trying capture shares on given file server. getting acl (access control list) share (doing manually atm). share, getting get-childitem. can me consolidate 1 line?

eventually have dump output csv.

get shares

get-wmiobject -class win32_share -computer server01 | ft path, name -autosize 

get acl given share

(get-acl c:\fileshare\testfolder01).access 

get-childitem given share

get-childitem c:\fileshare\testfolder02 -rec | select-object directoryname, name, creationtime, lastwritetime, extension | sort directoryname, name 

a oneliner pretty crazy do-able crazy. when ever run use loop of kind foreach , create ps custom object. below great blog post on how create custom ps objects. i'd recommend looking @ doing that.

http://www.powershellmagazine.com/2013/02/04/creating-powershell-custom-objects/


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -