You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did manage to fix this by doing a small modification to the Module. I don't know what have changed in the background as this script did work before. The change I did in the module was changing:
$PolicyAssignment = Get-MgPolicyRoleManagementPolicyAssignment -Filter "scopeId eq '/' and scopeType eq 'DirectoryRole' and roleDefinitionId eq '$($RoleAssignment.RoleDefinitionId)'" -ExpandProperty "policy($expand=rules)" at row 1636
to
$PolicyAssignment = Get-MgPolicyRoleManagementPolicyAssignment -Filter "scopeId eq '/' and scopeType eq 'DirectoryRole' and roleDefinitionId eq '$($RoleAssignment.RoleDefinitionId)'"
In short completely removing the -ExpandProperty parameter.
I will leave this issue opened as there might be a more proper way of fixing this.
jonas04anderberg
changed the title
Get-MgPolicyRoleManagementPolicyAssignment_List: Value cannot be null
Enable-DCEntraIDPIMRole error Get-MgPolicyRoleManagementPolicyAssignment_List: Value cannot be null
Dec 11, 2023
Hi! I'm getting this error when I run this command:
Enable-DCEntraIDPIMRole -RolesToActivate 'Exchange Administrator', 'Security Operator', 'Security Administrator', 'Intune Administrator', 'Authentication Administrator', 'Helpdesk Administrator', 'User Administrator', 'Teams Administrator', 'SharePoint Administrator' -Reason '-' -UseMaximumTimeAllowed
Get-MgPolicyRoleManagementPolicyAssignment_List: Value cannot be null. Parameter name: structuredType Status: 400 (BadRequest) ErrorCode: ArgumentNullException Date:
2023-12-06T07:54:33 Headers: Transfer-Encoding : chunked Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000 request-id : 04590c84-6cc9-407f-8b20-9c79013493ab
client-request-id : 56bf5eb8-d369-48e4-af13-65396818a619 x-ms-ags-diagnostic :
{"ServerInfo":{"DataCenter":"Sweden Central","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"GV3PEPF00000BF8"}} Date
: Wed, 06 Dec 2023 07:54:32 GMT
Enable-DCEntraIDPIMRole: Cannot bind argument to parameter 'UnifiedRoleManagementPolicyId' because it is an empty string.
Does anybody know whats going on?
The text was updated successfully, but these errors were encountered: