2

I want to prepare a list of persons having access to a given folder. The list should also contain the level of access granted. I figured out the following powershell command:

Get-Acl \\path\to\my\folder | Select-Object path -ExpandProperty Access | ft IdentityReference, FileSystemRights

This is almost what I need. I want to replace IdentityReference column with a column containing full user names. I am trying to achieve it by passing IdentityReference value to Get-QADUser cmdlet, but I do not know how to format the output to see both the full user name and FileSystemRights column.

1 Answer 1

1

try this, but untested

Get-Acl  | 
   Select-Object path -ExpandProperty Access | 
      select IdentityReference, FileSystemRights | 
         Select @{n='identity';e={$_.IdentityReference}},* | Get-QADUser
3
  • Thank you. I managed to run your code with minor modifications: I had to add .Value after $_.IdentityReference. But it still does not give the output I want. How to combine FileSystemRights returned by Get-Acl with Name property returned by Get-QADUser into a single table?
    – MBu
    Sep 4, 2012 at 15:49
  • After some experiments I managed to achieve the desired result: Get-Acl \\my\folder | Select-Object path -ExpandProperty Access | select @{n='User';e={ (Get-QADUser -Identity $_.IdentityReference.Value).Name }},FileSystemRights. I am accepting your answer as it pushed me in right direction :-)
    – MBu
    Sep 4, 2012 at 16:22
  • For those who do not want to install Active Directory Module form quest I modified the solution to work with built-in AD cmdlets: Get-Acl \\my\folder | Select-Object Path -ExpandProperty Access | Select-Object @{n='User';e={ (Get-ADUser -Identity $_.IdentityReference.Value.Split("\")[1]).Name }},FileSystemRights
    – MBu
    Jun 3, 2013 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .