Hello,
I have this script that is doing the job that I need it to do, however I cannot for the life of me figure out how to replace the write-output to export-csv and make it work. Here is what I am working with:
Powershell
$ReferenceAccountName='DOMAIN\Username'[string[]]$SearchDirectories=@('X:\SomeDirectory','F:\AnotherDirectory')foreach($RootDirin$SearchDirectories){$DirACL=Get-Acl-Path$RootDirforeach($ACLin$DirACL.Access){if($ACL.IdentityReference-like$ReferenceAccountName){Write-Output$RootDir}}foreach($Directoryin(Get-ChildItem-Path$RootDir-Recurse|`Where-Object-FilterScript{$_.Attributes`-contains'Directory'})){$DirACL=Get-Acl-Path$Directory.FullNameforeach($ACLin$DirACL.Access){if($ACL.IdentityReference-like$ReferenceAccountName){Write-Output$Directory.FullName}}}}...