After set connect-MgGraph with scope using below command in powershell but getting error.
Code: $endDate = (Get-Date).AddYears(3).ToString("yyyy-MM-ddTHH:mm:ssZ")
$body = @{
scheduleInfo = @{
expiration = @{
endDateTime = $endDate
}
}
} | ConvertTo-Json -Depth 10
Invoke-MgGraphRequest -Method PATCH -Body $body -Uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/c569798f-db4c-42a7-ad4d-6254a098667d"
Error:
Invoke-MgGraphRequest: PATCH https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleRequests/c569798f-db4c-42a7-ad4d-6254a098667d
HTTP/2.0 404 Not Found
Cache-Control: private
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: 3670cdb3-415d-4ebc-93fc-cb06d7d4fe21
client-request-id: b309c503-4a30-4e46-b205-5eb2e785dd97
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Central India","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"PN1PEPF00007039"}}
Date: Mon, 30 Dec 2024 12:56:48 GMT
Content-Type: application/json
Content-Encoding: gzip
{"error":{"code":"UnknownError","message":"{"message":"No HTTP resource was found that matches the request URI 'https://api.azrbac.mspim.azure.com/api/v3/roleManagement/directory/roleEligibilityScheduleRequests('c569798f-db4c-42a7-ad4d-6254a098667d')?'."}","innerError":{"date":"2024-12-30T12:56:49","request-id":"3670cdb3-415d-4ebc-93fc-cb06d7d4fe21","client-request-id":"b309c503-4a30-4e46-b205-5eb2e785dd97"}}}
Please help me for this issue i tried each way to update EndDate of assignment Role using API, if anyone know how to use API for update Assignment or Eligibility roles, please help me, any answers or input will be appreciate.