Skip to main content

entra pim role request list

Retrieves a list of PIM requests for roles

Usage

m365 entra pim role request list [options]

Options

--userId [userId]

Id of the user for which to list requests. Specify either userId, userName, groupId or groupName. If not specified, all requests will be listed.

--userName [userName]

UPN of the user for which to list requests. Specify either userId, userName, groupId or groupName. If not specified, all requests will be listed.

--groupId [groupId]

Id of the group for which to list requests. Specify either userId, userName, groupId or groupName. If not specified, all requests will be listed.

--groupName [groupName]

Display name of the group for which to list requests. Specify either userId, userName, groupId or groupName. If not specified, all requests will be listed.

-c, --createdDateTime [createdDateTime]

An optional ISO 8601 formatted date filter to search from.

-s, --status [status]

An optional value to filter the list of requests. Allowed values are: Canceled, Denied, Failed, Granted, PendingAdminDecision, PendingApproval, PendingProvisioning, PendingScheduleCreation, Provisioned, Revoked, and ScheduleCreated.

--includePrincipalDetails

An optional flag to include details of the principals that were assigned a role.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Examples

Get a list of PIM requests for roles.

m365 entra pim role request list

Get a list of PIM requests for the current user.

m365 entra pim role request list --userId '@meID'

Get a list of PIM requests for a specified user since the first of January 2024.

m365 entra pim role request list --createdDateTime 2024-01-01T00:00:00Z

Get a list of PIM requests with principal details.

m365 entra pim role request list --includePrincipalDetails

Get a list of PIM requests with pending approvals.

m365 entra pim role request list --status PendingApproval

Response

Standard response

[
{
"id": "80231d2f-95a1-47a5-8339-acf3d71efec7",
"status": "Revoked",
"createdDateTime": "2024-02-12T14:08:38.82Z",
"completedDateTime": null,
"approvalId": null,
"customData": null,
"action": "adminRemove",
"principalId": "61b0c52f-a902-4769-9a09-c6628335b00a",
"roleDefinitionId": "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"directoryScopeId": "/",
"appScopeId": null,
"isValidationOnly": false,
"targetScheduleId": null,
"justification": null,
"scheduleInfo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"displayName": null,
"id": "893f9116-e024-4bc6-8e98-54c245129485"
}
},
"ticketInfo": {
"ticketNumber": null,
"ticketSystem": null
},
"roleDefinitionName": "SharePoint Administrator"
}
]

includePrincipalDetails response

When we make use of the option includePrincipalDetails the response will differ.

[
{
"id": "80231d2f-95a1-47a5-8339-acf3d71efec7",
"status": "Revoked",
"createdDateTime": "2024-02-12T14:08:38.82Z",
"completedDateTime": null,
"approvalId": null,
"customData": null,
"action": "adminRemove",
"principalId": "61b0c52f-a902-4769-9a09-c6628335b00a",
"roleDefinitionId": "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
"directoryScopeId": "/",
"appScopeId": null,
"isValidationOnly": false,
"targetScheduleId": null,
"justification": null,
"scheduleInfo": null,
"createdBy": {
"application": null,
"device": null,
"user": {
"displayName": null,
"id": "893f9116-e024-4bc6-8e98-54c245129485"
}
},
"ticketInfo": {
"ticketNumber": null,
"ticketSystem": null
},
"roleDefinitionName": "SharePoint Administrator",
"principal": {
"id": "61b0c52f-a902-4769-9a09-c6628335b00a",
"displayName": "John Doe",
"userPrincipalName": "JohnDoe@contoso.onmicrosoft.com",
"mail": "JohnDoe@contoso.onmicrosoft.com",
"businessPhones": [
"+1 425 555 0109"
],
"givenName": "John",
"jobTitle": "Retail Manager",
"mobilePhone": null,
"officeLocation": "18/2111",
"preferredLanguage": "en-US",
"surname": "Doe"
}
}
]
CTRL + M