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.
Thank you. I managed to run your code with minor modifications: I had to add
.Valueafter$_.IdentityReference. But it still does not give the output I want. How to combineFileSystemRightsreturned by Get-Acl withNameproperty returned byGet-QADUserinto a single table? – MBu – 2012-09-04T15:49:02.570After 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 – 2012-09-04T16:22:11.127For 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 – 2013-06-03T07:36:19.053