Using powershell to return folder permissons -


i new powershell , trying use script found return folder permissions :

function get-secgroups($path)  {    $a = @{};   get-acl -path $path | %{write-host `n $path; $_.access} | %{     #only show permissions on folder, not files      #check see if user/group has "list" permission      if ($_.inheritanceflags -eq "containerinherit")      {        write-host `t $_.identityreference "list";     }     else      {        write-host `t $_.identityreference, $_.filesystemrights;      }    }  }  #end get-secgroups  get-childitem -path "d:\*\*\" | {$_.psiscontainer} | %{get-secgroups($_.fullname)} | out-file c:\output.txt  

the problem have creates output.txt no data. data displayed on screen. going wrong?

juste replace write-host write-output in function.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -