Powershell Need Help using AlphaFS to recurse folders

Jan 22, 2015 at 3:56 PM

I am using PowerShell 2.0 on my server and I wrote the script below to recurse all subfolders and find every folder that a particular user has permissions to access. The script works great untill it encounter the long paths. Can someone please help me to do the same thing using AlphaFS so that I can actually locate the complete list and add another user to those exact folders with the same ACLs.
#Set variables
$Path = “d:\"
$UserName = "ABC\Username"
$filename = "c:\Temp\ACLResult.csv"

$folders = Get-ChildItem -path $Path -force -recurse | Where {$_.PSIsContainer}
ForEach ($folder in $folders)
  $PSPath = (Convert-Path $folder.pspath)
  if (Get-Acl -path $PSPath |Select -ExpandProperty Access| Where {$_.IdentityReference -like  $UserName})
     $ACLInherited = Get-Acl -path $PSPath |Select -ExpandProperty Access| Where {$_.IdentityReference -like $UserName} 
     $list = ("$PSPath")
     $list, $ACLInherited.IsInherited | format-table |Out-File -append $filename
    } #end-if
Thank you for your help!
Jan 26, 2015 at 5:52 AM
Edited Jan 26, 2015 at 5:52 AM
I have a similar interest for recursing folders and finding older (7 days) folders/files for deleting - so we are two with a similar problem ... it would be worth to help us twice ;) ... please help us!
Jan 26, 2015 at 1:54 PM
Edited Jan 26, 2015 at 1:55 PM
So far I got this far in my Powershell code, as long as I have permissions to access the folder. Otherwise it just stops with an error message instead of moving to the next folder in the tree

#Load Assembly DLL

#Initialise Variables
$Path = "D:\"

#Read all folders into $Folders Array Variable
$Folders= [Alphaleonis.Win32.Filesystem.Directory]::GetDirectories($Path,"*","AllDirectories") 

#Display each Folder
Foreach ($Folder in $Folders) 
get-acl $Folder
Exception calling "GetDirectories" with "3" argument(s): "(5) Access is denied: [\\?\d:\FolderName"
At C:\Get-AllFolders.ps1:8 char:67
+ $Folders= [Alphaleonis.Win32.Filesystem.Directory]::GetDirectories <<<< ($Path,"*","AllDirectories")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException
Jan 26, 2015 at 8:49 PM
We are not on CodePlex anymore.

Please check: https://github.com/alphaleonis/AlphaFS/wiki
Jan 29, 2015 at 7:40 AM
AlphaFS Issues can be reported here: https://github.com/alphaleonis/AlphaFS/issues