microsoftgraph / microsoftgraph/msgraph-sdk-powershell

BUG | Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest

Open
#3,062 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Investigation type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest does not return all schedule

Expected behavior

All Eligible assignments return

How to reproduce
  1. Create Role assignable Security group
  2. Assign permanent eligibility for Yammer Administrator and Attribute Definition Reader
  3. Run code below
  4. Output only returns Attribute Definition Reader
import-module Microsoft.Graph.Beta.Identity.Governance
$TenantId = 'cd0036eb-1e0c-4496-bf8f-8eca88154645'
$AppId ="ff3521f3-6043-4ef5-a7da-7ba2f87a66f2" #customRoleCreator
$Thumbprint = Get-ChildItem "cert:\CurrentUser\My" |
            Where-Object {$_.Subject -like "CN=monkey01CustomRoleCreator00*" } | 
                Select-Object -ExpandProperty Thumbprint



Connect-MgGraph -TenantId $TenantId -ClientId $AppId -CertificateThumbprint $Thumbprint # -ContextScope 'Process'
Get-MgContext



$PrincipalInstance = 'e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27' # role assignable group
$RoleDefinitionId = '810a2642-a034-447f-a5e8-41beaa378541' # Yammer Administrator
$DirectoryScopeId = '/' # directory scope
Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest -Filter "PrincipalId eq '$($PrincipalInstance)' and DirectoryScopeId eq '/$($DirectoryScopeId)'"

Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest -Filter "PrincipalId eq '$($PrincipalInstance)' and RoleDefinitionId eq '$($RoleDefinitionId)' and DirectoryScopeId eq '/$($DirectoryScopeId)'"

Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest -Filter "PrincipalId eq '$($PrincipalInstance)'"

image

PS C:\Users\Administrator\Desktop>
>> Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest -Filter "PrincipalId eq '$($PrincipalInstance)'"

ApprovalId CompletedDateTime     CreatedDateTime       CustomData Id                                   Status      Action      AppScopeId DirectoryScopeId IsValidationOnly Justification PrincipalId                          RoleDefinitionId
---------- -----------------     ---------------       ---------- --                                   ------      ------      ---------- ---------------- ---------------- ------------- -----------                          ----------------  
           12/23/2024 7:03:02 PM 12/23/2024 7:03:02 PM            d0ab367c-546e-4d53-a5fa-64aafe9a619a Provisioned AdminUpdate            /                False            test          e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 9b895d92-2cd3-44… 

Diving deeper, I performed graph calls which return the expected role schedule asignments.

$HeaderParams = @{}
$HeaderParams.Add('ConsistencyLevel', "$ConsistencyLevel")
$Uri = "/beta/roleManagement/directory/roleDefinitions"
$Uri = "https://graph.microsoft.com$Uri"

$URI = "https://graph.microsoft.com/beta/roleManagement/directory/roleEligibilityScheduleRequests?`$filter=PrincipalId eq 'e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27'"
$Method = 'GET'
$OutputType = "PSObject"

$QueryRequest = Invoke-MgGraphRequest -Headers $HeaderParams -Uri $Uri -Method $Method -ContentType "application/json" -OutputType $OutputType


PS C:\Users\Administrator\Desktop> $queryrequest.value | ft

id                                   status      createdDateTime       completedDateTime     approvalId customData action      principalId                          roleDefinitionId                     directoryScopeId
--                                   ------      ---------------       -----------------     ---------- ---------- ------      -----------                          ----------------                     ----------------
ffbe8107-8b0a-4eab-81f6-7c2f8b9ba07b Provisioned 12/23/2024 6:59:01 PM 12/23/2024 6:59:01 PM                       AdminAssign e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3 /
40ccf9b4-e577-4ae4-88ca-0da1c4d2c0cd Provisioned 12/23/2024 6:29:09 PM 12/23/2024 6:29:09 PM                       AdminUpdate e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 810a2642-a034-447f-a5e8-41beaa378541 /
82d7ba49-6852-474d-a370-adedb7b0be88 Provisioned 12/23/2024 6:59:27 PM 12/23/2024 6:59:27 PM                       AdminAssign e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 1d336d2c-4ae8-42ef-9711-b3604ce3fc2c /
1126afa4-8d7e-4711-82fb-46b1b965e2c7 Revoked     12/23/2024 9:19:41 PM                                             AdminRemove e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 810a2642-a034-447f-a5e8-41beaa378541 /
6606bcf2-14ba-4bd6-a35c-fe4d3c4d57a0 Provisioned 12/23/2024 9:23:27 PM 12/23/2024 9:23:27 PM                       AdminAssign e2cd15bb-aa73-4e8b-85ae-fcca0ebe1c27 810a2642-a034-447f-a5e8-41beaa378541 /


SDK Version

2.24

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

Name Value


PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.20348
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0


### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest in the Microsoft.Graph.Beta.Identity.Governance module and reproduce the PrincipalId filter shown in the issue. Compare its results with the beta roleEligibilityScheduleRequests endpoint and existing SDK tests, if available. Done means the cmdlet returns all eligible assignments shown by the direct Graph request.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.