I'm new to Powershell and I need to know how to list all permissions of a folder for a specific user. This is what I have discovered so far:
However, this does not return any value with the Write-Output command. Changing it to Write-Host didn't work as well. Am I missing some crucial parts?
$user = "testumgebung\cbruehwiler"
$path = "T:\"
$list = Get-ChildItem $path -Recurse | Where-Object {(Get-Acl $_.FullName).Access | Where-Object {$_.IdentityReference -eq $user} }
Write-Output $list
This does return a list with folders, where I have access to. But it would be better if I can get a list with all the folders where I have access to and list the permissions I have (read, write, execute, full control).
This is a sample of the list:
Directory: T:\
Mode: d----
LastWriteTime: 17.04.2019 08:25
Name: TestFolder