I am trying to get a security role report similar to that in the post Security Role - Report I have also read up on the post at http://www.adaxes.com/sdk/?ManagingSecurityRoles.html
The trouble I am having is that report does not show what the permission the roles specifically have. I would like to have a report that shows:
RoleName, RoleDescription, RolePermission, Membership
I understand role permission would be an array of values as there are multiple, and that it would be something like AccessMask = AccessType (IE: {Create User Objects = Allow;Delete User Objects = Deny} )
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$global:admService = $admNS.GetServiceDirectly("localhost")
# Find all Security Roles
$securityRolesPath = $global:admService.Backend.GetConfigurationContainerPath("AccessControlRoles")
$searcher = $global:admService.OpenObject($securityRolesPath, $NULL, $NULL, 0)
$searcher.SearchFilter = "(objectCategory=adm-Role)"
$searcher.PageSize = 500
$searcher.SearchScope = "ADS_SCOPE_SUBTREE"
$searchResult = $searcher.ExecuteSearch()
$roles = $searchResult.FetchAll()
#This is where I bind to one role
$roleid = $roles[4]
$role = $global:admService.OpenObject($roleId.AdsPath, $NULL, $NULL, 0)
#this is where I show just the GUIDS of the role assignments, I need to see the assignment itself (IE: AccessType = "ADM_PERMISSION_TYPE_ALLOW" AccessMask = "ADS_RIGHT_DS_DELETE_CHILD" )
$role.Get("adm-RoleAssignments")
#Instead I get:
CN=51f44b61-8439-40b1-afb4-af81d7922508,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes
CN=36b2c167-8d82-4bff-a589-ea06619bf0fb,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes
CN=375c99aa-6604-4f2d-bf0d-9b7fbdca7759,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes
CN=08db0ae0-443a-4c8a-bac0-fd180bb0a904,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes
CN=716c5338-6173-4877-8638-650fac0a3518,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes
CN=3ffbfd5c-59e9-417f-a271-b3ebfba51684,CN=HR Manager,CN=Builtin,CN=Security Roles,CN=Access Control,CN=Configuration Objects,CN=Adaxes Configuration,CN=Adaxes