命名空间:microsoft.graph
在 PIM for Groups 中,检索对由 PIM 管理的组的调用主体的成员身份或所有权分配的请求。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
PrivilegedAssignmentSchedule.Read.AzureADGroup |
PrivilegedAssignmentSchedule.ReadWrite.AzureADGroup |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
PrivilegedAssignmentSchedule.Read.AzureADGroup |
PrivilegedAssignmentSchedule.ReadWrite.AzureADGroup |
重要
在具有工作或学校帐户的委托方案中,登录用户必须是组的所有者或成员,或者分配有受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。 此作支持以下最低特权角色。
- 对于可分配角色的组: 全局读取者 或 特权角色管理员
- 对于不可分配角色的组: 全局读取者、 目录编写器、 组管理员、 标识治理管理员或 用户管理员
调用用户的角色分配应限定在目录级别。
具有管理组 (权限的其他角色(例如,非角色可分配Microsoft 365 个组的 Exchange 管理员)) 和分配范围在管理单元级别分配的管理员,可以通过组 API 管理组,并通过组 API 替代 Microsoft Entra PIM 中所做的更改。
HTTP 请求
GET /identityGovernance/privilegedAccess/group/assignmentScheduleRequests/filterByCurrentUser(on='parameterValue')
函数参数
在请求 URL 中,提供以下查询参数(含值)。
下表显示了可用于此函数的参数。
参数 |
类型 |
说明 |
on |
assignmentScheduleRequestFilterByCurrentUserOptions |
用于查询 assignmentScheduleRequests 的筛选器。 可能的值为 principal 、、createdBy 、approver unknownFutureValue 。 必需。 |
名称 |
说明 |
Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此函数在 200 OK
响应正文中返回响应代码和 privilegedAccessGroupAssignmentScheduleRequest 集合。
示例
示例 1:检索范围限定为特定组且正在等待审批的主体请求
请求
GET https://graph.microsoft.com/v1.0/identityGovernance/privilegedAccess/group/assignmentScheduleRequests/filterByCurrentUser(on='principal')?$filter=status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.PrivilegedAccess.Group.AssignmentScheduleRequests.FilterByCurrentUserWithOn("principal").GetAsFilterByCurrentUserWithOnGetResponseAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
//other-imports
)
requestFilter := "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'"
requestParameters := &graphidentitygovernance.PrivilegedAccessGroupAssignmentScheduleRequestsFilterByCurrentUserWithOnRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphidentitygovernance.PrivilegedAccessGroupAssignmentScheduleRequestsFilterByCurrentUserWithOnRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
on := "principal"
filterByCurrentUser, err := graphClient.IdentityGovernance().PrivilegedAccess().Group().AssignmentScheduleRequests().FilterByCurrentUserWithOn(&on).GetAsFilterByCurrentUserWithOnGetResponse(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
var result = graphClient.identityGovernance().privilegedAccess().group().assignmentScheduleRequests().filterByCurrentUserWithOn("principal").get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let filterByCurrentUser = await client.api('/identityGovernance/privilegedAccess/group/assignmentScheduleRequests/filterByCurrentUser(on='principal')')
.filter('status eq \'PendingApproval\' and groupId eq \'d5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc\'')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\IdentityGovernance\PrivilegedAccess\Group\AssignmentScheduleRequests\FilterByCurrentUser(on='{on}')\FilterByCurrentUserWithOnRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new FilterByCurrentUserWithOnRequestBuilderGetRequestConfiguration();
$queryParameters = FilterByCurrentUserWithOnRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->identityGovernance()->privilegedAccess()->group()->assignmentScheduleRequests()->filterByCurrentUserWithOn('principal', )->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
Invoke-MgFilterIdentityGovernancePrivilegedAccessGroupAssignmentScheduleRequestByCurrentUser -Filter "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'" -On $onId
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.privileged_access.group.assignment_schedule_requests.filter_by_current_user(on='{on}').filter_by_current_user_with_on_request_builder import FilterByCurrentUserWithOnRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = FilterByCurrentUserWithOnRequestBuilder.FilterByCurrentUserWithOnRequestBuilderGetQueryParameters(
filter = "status eq 'PendingApproval' and groupId eq 'd5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.privileged_access.group.assignment_schedule_requests.filter_by_current_user_with_on("principal").get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.privilegedAccessGroupAssignmentScheduleRequest",
"id": "12345",
"accessId": "member",
"principalId": "c277c8cb-6bb7-42e5-a17f-0add9a718151",
"groupId": "d5f0ad2e-6b34-401b-b6da-0c8fc2c5a3fc",
"status": "PendingApproval",
"createdDateTIme": "2022-02-26T08:00:00.000Z",
"completedDateTIme": null,
"isValidationOnly": false,
"action": "SelfActivate",
"scheduleInfo":
{
"startDateTime": "2022-04-01T08:00:00.000Z",
"expiration":
{
"type": "AfterDuration",
"duration" : "PT8H",
}
},
"justification":"Activate access",
"ticketInfo":
{
"ticketNumber": "09876"
}
}
]
}