Skip to content

Commit

Permalink
Update DCToolbox.psm1
Browse files Browse the repository at this point in the history
Removed -ExpandProperty "policy(`$expand=rules)" so that the script works again. This seems to be solving issue DanielChronlund#41
  • Loading branch information
jonas04anderberg authored Dec 11, 2023
1 parent 5b7a65e commit eb6599f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DCToolbox/DCToolbox.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ function Enable-DCEntraIDPIMRole {
$CustomObject | Add-Member -MemberType NoteProperty -Name 'RoleDefinitionId' -Value $RoleAssignment.RoleDefinitionId
$CustomObject | Add-Member -MemberType NoteProperty -Name 'DisplayName' -Value ($EntraIDRoleTemplates | Where-Object { $_.Id -eq $RoleAssignment.RoleDefinitionId } ).DisplayName

$PolicyAssignment = Get-MgPolicyRoleManagementPolicyAssignment -Filter "scopeId eq '/' and scopeType eq 'DirectoryRole' and roleDefinitionId eq '$($RoleAssignment.RoleDefinitionId)'" -ExpandProperty "policy(`$expand=rules)"
$PolicyAssignment = Get-MgPolicyRoleManagementPolicyAssignment -Filter "scopeId eq '/' and scopeType eq 'DirectoryRole' and roleDefinitionId eq '$($RoleAssignment.RoleDefinitionId)'"

# Get the role management policy that's been assigned:
$Policy = Get-MgPolicyRoleManagementPolicy -UnifiedRoleManagementPolicyId $PolicyAssignment.PolicyId
Expand Down

0 comments on commit eb6599f

Please sign in to comment.