Verwalten des Zugriffs auf Ressourcen mithilfe der Berechtigungsverwaltungs-APIs
Artikel
Microsoft Entra Berechtigungsverwaltung können Sie den Zugriff auf Ressourcen verwalten, die Mitarbeiter benötigen, um produktiv zu sein. In diesem Tutorial verwenden Sie die Berechtigungsverwaltungs-APIs, um ein Ressourcenpaket zu erstellen, das interne Benutzer selbst anfordern. Die APIs sind die programmgesteuerte Alternative zum Erstellen benutzerdefinierter Apps anstelle der verwendung der Microsoft Entra Admin Center.
In diesem Tutorial wird Folgendes vermittelt:
Erstellen Sie ein Zugriffspaket, das Benutzer self-Service anfordern können.
Weisen Sie dem Zugriffspaket eine Gruppenressource zu.
Anfordern eines Zugriffspakets
Voraussetzungen
Für dieses Tutorial benötigen Sie die folgenden Ressourcen und Berechtigungen:
Ein Funktionierender Microsoft Entra Mandant mit aktivierter Microsoft Entra ID P2- oder Microsoft Entra ID Governance-Lizenz. Eine dieser Lizenzen ist für die Funktionen in diesem Tutorial ausreichend.
Ein Testgastkonto und eine Testsicherheitsgruppe in Ihrem Mandanten. Die Sicherheitsgruppe ist die Ressource in diesem Tutorial. Stellen Sie sicher, dass Sie entweder der Besitzer der Gruppe oder die Rolle Gruppenadministrator zugewiesen sind. In diesem Tutorial:
Der Benutzer verfügt über die ID 007d1c7e-7fa8-4e33-b678-5e437acdcddc und hat den Namen Requestor1.
[Optional] Öffnen Sie ein neues anonymes Browserfenster. Sie melden sich später in diesem Tutorial an.
Die Gruppe verfügt über die ID f4892fac-e81c-4712-bdf2-a4450008a4b0 mit der Beschreibung "Marketinggruppe" und dem Anzeigenamen "Marketingressourcen".
Melden Sie sich bei einem API-Client wie Graph Explorer mit einem Konto an, das mindestens über die Rolle Identity Governance-Administrator verfügt.
Gewähren Sie sich die folgenden delegierten Berechtigungen: User.ReadWrite.All, Group.ReadWrite.Allund EntitlementManagement.ReadWrite.All.
Hinweis
Einige Schritte in diesem Tutorial verwenden den beta Endpunkt.
Schritt 1: Hinzufügen von Ressourcen zu einem Katalog und Erstellen eines Zugriffspakets
Ein Zugriffspaket ist ein Bündel von Ressourcen, die ein Team oder Projekt benötigt und das mit Richtlinien gesteuert wird. Zugriffspakete werden in Containern definiert, die als Kataloge bezeichnet werden. Kataloge können auf Ressourcen wie Gruppen, Apps und Websites verweisen, die im Zugriffspaket verwendet werden. Die Berechtigungsverwaltung umfasst einen Standardkatalog General .
In diesem Schritt erstellen Sie ein Zugriffspaket für die Marketingkampagne im Katalog Allgemein.
Schritt 1.1: Abrufen des Bezeichners für den allgemeinen Katalog
Rufen Sie zunächst die ID des Katalogs ab, dem Sie Ressourcen hinzufügen möchten.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs?$filter=(displayName eq 'General')
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "(displayName eq 'General')";
});
// 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 := "(displayName eq 'General')"
requestParameters := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
catalogs, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageCatalogCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "(displayName eq 'General')";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.catalogs_request_builder import CatalogsRequestBuilder
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 = CatalogsRequestBuilder.CatalogsRequestBuilderGetQueryParameters(
filter = "(displayName eq 'General')",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.get(request_configuration = request_configuration)
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/entitlementManagement/catalogs",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET identityGovernance/entitlementManagement/catalogs?$select=catalogType,createdDateTime",
"value": [
{
"id": "cec5d6ab-c75d-47c0-9c1c-92e89f66e384",
"displayName": "General",
"description": "Built-in catalog.",
"catalogType": "serviceDefault",
"state": "published",
"isExternallyVisible": true,
"createdDateTime": "2023-04-13T14:43:19.44Z",
"modifiedDateTime": "2023-04-13T14:43:19.44Z"
}
]
}
Schritt 1.2: Hinzufügen der Gruppe zum Katalog
In diesem Tutorial ist die Ressource eine Sicherheitsgruppe mit der ID e93e24d1-2b65-4a6c-a1dd-654a12225487.
Um die Gruppe, die Sie erstellt haben, dem Katalog hinzuzufügen, geben Sie die folgenden Eigenschaftswerte an:
catalogId : die ID des Katalogs, den Sie verwenden.
originId : die ID der Gruppe, die Sie erstellt haben.
Wenn Sie nicht der Besitzer der Gruppe sind, auf die Sie in originId verweisen, oder wenn Ihnen nicht die Rolle Gruppenadministrator zugewiesen ist, schlägt diese Anforderung mit einem 403 Forbidden Fehlercode fehl.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new AccessPackageResourceRequest
{
RequestType = AccessPackageRequestType.AdminAdd,
AdditionalData = new Dictionary<string, object>
{
{
"catalogId" , "cec5d6ab-c75d-47c0-9c1c-92e89f66e384"
},
{
"justification" , ""
},
{
"accessPackageResource" , new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"resourceType", new UntypedString("AadGroup")
},
{
"originId", new UntypedString("e93e24d1-2b65-4a6c-a1dd-654a12225487")
},
{
"originSystem", new UntypedString("AadGroup")
},
})
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.ResourceRequests.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRequest accessPackageResourceRequest = new AccessPackageResourceRequest();
accessPackageResourceRequest.setRequestType(AccessPackageRequestType.AdminAdd);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("catalogId", "cec5d6ab-c75d-47c0-9c1c-92e89f66e384");
additionalData.put("justification", "");
accessPackageResource = new ();
accessPackageResource.setResourceType("AadGroup");
accessPackageResource.setOriginId("e93e24d1-2b65-4a6c-a1dd-654a12225487");
accessPackageResource.setOriginSystem("AadGroup");
additionalData.put("accessPackageResource", accessPackageResource);
accessPackageResourceRequest.setAdditionalData(additionalData);
AccessPackageResourceRequest result = graphClient.identityGovernance().entitlementManagement().resourceRequests().post(accessPackageResourceRequest);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.access_package_resource_request import AccessPackageResourceRequest
from msgraph.generated.models.access_package_request_type import AccessPackageRequestType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageResourceRequest(
request_type = AccessPackageRequestType.AdminAdd,
additional_data = {
"catalog_id" : "cec5d6ab-c75d-47c0-9c1c-92e89f66e384",
"justification" : "",
"access_package_resource" : {
"resource_type" : "AadGroup",
"origin_id" : "e93e24d1-2b65-4a6c-a1dd-654a12225487",
"origin_system" : "AadGroup",
},
}
)
result = await graph_client.identity_governance.entitlement_management.resource_requests.post(request_body)
In dieser Antwort stellt die ID die ID für die Gruppe als Ressource im Katalog Allgemein dar. Diese ID ist nicht die Gruppen-ID. Notieren Sie sich diese ID.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
In diesem Schritt rufen Sie die Details der Ressourcen ab, die der ID der Gruppenressource entsprechen, die Sie dem Katalog Allgemein hinzugefügt haben.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/cec5d6ab-c75d-47c0-9c1c-92e89f66e384/resources?$filter=originId eq 'e93e24d1-2b65-4a6c-a1dd-654a12225487'
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].Resources.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "originId eq 'e93e24d1-2b65-4a6c-a1dd-654a12225487'";
});
// 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 := "originId eq 'e93e24d1-2b65-4a6c-a1dd-654a12225487'"
requestParameters := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogItemResourcesRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogItemResourcesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
resources, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").Resources().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").resources().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "originId eq 'e93e24d1-2b65-4a6c-a1dd-654a12225487'";
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.item.resources.resources_request_builder import ResourcesRequestBuilder
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 = ResourcesRequestBuilder.ResourcesRequestBuilderGetQueryParameters(
filter = "originId eq 'e93e24d1-2b65-4a6c-a1dd-654a12225487'",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').resources.get(request_configuration = request_configuration)
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/entitlementManagement/catalogs('cec5d6ab-c75d-47c0-9c1c-92e89f66e384')/resources",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET identityGovernance/entitlementManagement/catalogs('<guid>')/resources?$select=attributes,createdDateTime",
"value": [
{
"id": "4a1e21c5-8a76-4578-acb1-641160e076e8",
"displayName": "Marketing resources",
"description": "Marketing group",
"originId": "e93e24d1-2b65-4a6c-a1dd-654a12225487",
"originSystem": "AadGroup",
"createdDateTime": "2024-03-26T09:44:50.527Z",
"attributes": []
}
]
}
Schritt 1.4: Abrufen von Ressourcenrollen
Das Zugriffspaket weist Benutzer den Rollen einer Ressource zu. Die typische Rolle einer Gruppe ist die Member Rolle. Andere Ressourcen, z. B. SharePoint Online-Websites und -Anwendungen, haben möglicherweise viele Rollen. Die typische Rolle einer Gruppe, die in einem Zugriffspaket verwendet wird, ist die Member Rolle. Sie benötigen die Memberrolle, um dem Zugriffspaket später in diesem Tutorial eine Ressourcenrolle hinzuzufügen.
Verwenden Sie in der Anforderung die ID des Katalogs und die ID der Gruppenressource im Katalog, den Sie notiert haben, um die originId der Member-Ressourcenrolle abzurufen. Notieren Sie sich den Wert der originId-Eigenschaft , die später in diesem Tutorial verwendet werden soll.
GET https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/ede67938-cda7-4127-a9ca-7c7bf86a19b7/resourceRoles?$filter=(originSystem eq 'AadGroup' and displayName eq 'Member' and resource/id eq '274a1e21c5-8a76-4578-acb1-641160e076e')&$expand=resource
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.Catalogs["{accessPackageCatalog-id}"].ResourceRoles.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "(originSystem eq 'AadGroup' and displayName eq 'Member' and resource/id eq '274a1e21c5-8a76-4578-acb1-641160e076e')";
requestConfiguration.QueryParameters.Expand = new string []{ "resource" };
});
// 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 := "(originSystem eq 'AadGroup' and displayName eq 'Member' and resource/id eq '274a1e21c5-8a76-4578-acb1-641160e076e')"
requestParameters := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogItemResourceRolesRequestBuilderGetQueryParameters{
Filter: &requestFilter,
Expand: [] string {"resource"},
}
configuration := &graphidentitygovernance.IdentityGovernanceEntitlementManagementCatalogItemResourceRolesRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
resourceRoles, err := graphClient.IdentityGovernance().EntitlementManagement().Catalogs().ByAccessPackageCatalogId("accessPackageCatalog-id").ResourceRoles().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageResourceRoleCollectionResponse result = graphClient.identityGovernance().entitlementManagement().catalogs().byAccessPackageCatalogId("{accessPackageCatalog-id}").resourceRoles().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "(originSystem eq 'AadGroup' and displayName eq 'Member' and resource/id eq '274a1e21c5-8a76-4578-acb1-641160e076e')";
requestConfiguration.queryParameters.expand = new String []{"resource"};
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.entitlement_management.catalogs.item.resource_roles.resource_roles_request_builder import ResourceRolesRequestBuilder
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 = ResourceRolesRequestBuilder.ResourceRolesRequestBuilderGetQueryParameters(
filter = "(originSystem eq 'AadGroup' and displayName eq 'Member' and resource/id eq '274a1e21c5-8a76-4578-acb1-641160e076e')",
expand = ["resource"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.catalogs.by_access_package_catalog_id('accessPackageCatalog-id').resource_roles.get(request_configuration = request_configuration)
Da Sie nach originId, Anzeigename und Ressourcen-ID gefiltert haben, wird bei erfolgreicher Ausführung ein einzelner Wert zurückgegeben, der die Member-Rolle dieser Gruppe darstellt. Wenn keine Rollen zurückgegeben werden, überprüfen Sie die ID-Werte des Katalogs und der Zugriffspaketressource.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/entitlementManagement/catalogs('ede67938-cda7-4127-a9ca-7c7bf86a19b7')/resourceRoles(resource())",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET identityGovernance/entitlementManagement/catalogs('<guid>')/resourceRoles?$select=description,displayName",
"value": [
{
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Member",
"description": null,
"originSystem": "AadGroup",
"originId": "Member_e93e24d1-2b65-4a6c-a1dd-654a12225487",
"resource@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/entitlementManagement/catalogs('ede67938-cda7-4127-a9ca-7c7bf86a19b7')/resourceRoles('00000000-0000-0000-0000-000000000000')/resource/$entity",
"resource": {
"id": "ec09e90e-e021-4599-a8c3-bce77c2b2000",
"displayName": "Marketing resources",
"description": "Marketing group",
"originId": "e93e24d1-2b65-4a6c-a1dd-654a12225487",
"originSystem": "AadGroup",
"createdDateTime": "2023-04-13T14:43:21.43Z",
"attributes": []
}
}
]
}
Schritt 1.5: Erstellen des Zugriffspakets
Sie verfügen nun über einen Katalog mit einer Gruppenressource, und Sie möchten die Ressourcenrolle des Gruppenmitglieds im Zugriffspaket verwenden. Der nächste Schritt besteht darin, das Zugriffspaket zu erstellen. Nachdem Sie über das Zugriffspaket verfügen, können Sie ihr die Ressourcenrolle hinzufügen und eine Richtlinie erstellen, die beschreibt, wie Benutzer Zugriff auf diese Ressourcenrolle anfordern können. Sie verwenden die ID des Katalogs, den Sie zuvor notiert haben, um das Zugriffspaket zu erstellen. Notieren Sie sich die ID des Zugriffspakets, das später in diesem Tutorial verwendet werden soll.
POST https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/accessPackages
Content-type: application/json
{
"catalogId": "cec5d6ab-c75d-47c0-9c1c-92e89f66e384",
"displayName": "Marketing Campaign",
"description": "Access to resources for the campaign"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AccessPackage
{
DisplayName = "Marketing Campaign",
Description = "Access to resources for the campaign",
AdditionalData = new Dictionary<string, object>
{
{
"catalogId" , "cec5d6ab-c75d-47c0-9c1c-92e89f66e384"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackages.PostAsync(requestBody);
// 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"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackage()
displayName := "Marketing Campaign"
requestBody.SetDisplayName(&displayName)
description := "Access to resources for the campaign"
requestBody.SetDescription(&description)
additionalData := map[string]interface{}{
"catalogId" : "cec5d6ab-c75d-47c0-9c1c-92e89f66e384",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackages, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackages().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackage accessPackage = new AccessPackage();
accessPackage.setDisplayName("Marketing Campaign");
accessPackage.setDescription("Access to resources for the campaign");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("catalogId", "cec5d6ab-c75d-47c0-9c1c-92e89f66e384");
accessPackage.setAdditionalData(additionalData);
AccessPackage result = graphClient.identityGovernance().entitlementManagement().accessPackages().post(accessPackage);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AccessPackage;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackage();
$requestBody->setDisplayName('Marketing Campaign');
$requestBody->setDescription('Access to resources for the campaign');
$additionalData = [
'catalogId' => 'cec5d6ab-c75d-47c0-9c1c-92e89f66e384',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackages()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.access_package import AccessPackage
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackage(
display_name = "Marketing Campaign",
description = "Access to resources for the campaign",
additional_data = {
"catalog_id" : "cec5d6ab-c75d-47c0-9c1c-92e89f66e384",
}
)
result = await graph_client.identity_governance.entitlement_management.access_packages.post(request_body)
Das Zugriffspaket verfügt jetzt über eine Ressourcenrolle, die Gruppenmitgliedschaft. Die Rolle wird jedem Benutzer zugewiesen, der über das Zugriffspaket verfügt.
Schritt 1.7: Erstellen einer Zugriffspaketrichtlinie
Nachdem Sie das Zugriffspaket erstellt und Ressourcen und Rollen hinzugefügt haben, können Sie entscheiden, wer darauf zugreifen kann, indem Sie eine Zugriffspaketrichtlinie erstellen. In diesem Tutorial aktivieren Sie das von Ihnen erstellte Requestor1-Konto , um Zugriff auf die Ressourcen im Zugriffspaket anzufordern. Für diese Aufgabe benötigen Sie die folgenden Werte:
ID des Zugriffspakets für den Wert der accessPackageId-Eigenschaft
ID des Benutzerkontos Requestor1 für den Wert der Id-Eigenschaft in allowedRequestors
Der Wert der durationInDays-Eigenschaft ermöglicht es dem Requestor1-Konto , bis zu 30 Tage lang auf die Ressourcen im Zugriffspaket zuzugreifen. Notieren Sie sich den Wert der id-Eigenschaft , die später in diesem Tutorial zur Verwendung zurückgegeben wird.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageAssignmentPolicy
{
AccessPackageId = "88203d16-0e31-41d4-87b2-dd402f1435e9",
DisplayName = "Specific users",
Description = "Specific users can request assignment",
AccessReviewSettings = null,
DurationInDays = 30,
RequestorSettings = new RequestorSettings
{
ScopeType = "SpecificDirectorySubjects",
AcceptRequests = true,
AllowedRequestors = new List<UserSet>
{
new SingleUser
{
OdataType = "#microsoft.graph.singleUser",
IsBackup = false,
Id = "007d1c7e-7fa8-4e33-b678-5e437acdcddc",
Description = "Requestor1",
},
},
},
RequestApprovalSettings = new ApprovalSettings
{
IsApprovalRequired = false,
IsApprovalRequiredForExtension = false,
IsRequestorJustificationRequired = false,
ApprovalMode = "NoApproval",
ApprovalStages = new List<ApprovalStage>
{
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentPolicies.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentPolicy accessPackageAssignmentPolicy = new AccessPackageAssignmentPolicy();
accessPackageAssignmentPolicy.setAccessPackageId("88203d16-0e31-41d4-87b2-dd402f1435e9");
accessPackageAssignmentPolicy.setDisplayName("Specific users");
accessPackageAssignmentPolicy.setDescription("Specific users can request assignment");
accessPackageAssignmentPolicy.setAccessReviewSettings(null);
accessPackageAssignmentPolicy.setDurationInDays(30);
RequestorSettings requestorSettings = new RequestorSettings();
requestorSettings.setScopeType("SpecificDirectorySubjects");
requestorSettings.setAcceptRequests(true);
LinkedList<UserSet> allowedRequestors = new LinkedList<UserSet>();
SingleUser userSet = new SingleUser();
userSet.setOdataType("#microsoft.graph.singleUser");
userSet.setIsBackup(false);
userSet.setId("007d1c7e-7fa8-4e33-b678-5e437acdcddc");
userSet.setDescription("Requestor1");
allowedRequestors.add(userSet);
requestorSettings.setAllowedRequestors(allowedRequestors);
accessPackageAssignmentPolicy.setRequestorSettings(requestorSettings);
ApprovalSettings requestApprovalSettings = new ApprovalSettings();
requestApprovalSettings.setIsApprovalRequired(false);
requestApprovalSettings.setIsApprovalRequiredForExtension(false);
requestApprovalSettings.setIsRequestorJustificationRequired(false);
requestApprovalSettings.setApprovalMode("NoApproval");
LinkedList<ApprovalStage> approvalStages = new LinkedList<ApprovalStage>();
requestApprovalSettings.setApprovalStages(approvalStages);
accessPackageAssignmentPolicy.setRequestApprovalSettings(requestApprovalSettings);
AccessPackageAssignmentPolicy result = graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentPolicies().post(accessPackageAssignmentPolicy);
In diesem Schritt fordert das Benutzerkonto Requestor1 Zugriff auf die Ressourcen im Zugriffspaket an.
Um zugriff auf Ressourcen im Zugriffspaket anzufordern, müssen Sie die folgenden Werte angeben:
ID des Requestor1-Benutzerkontos , das Sie für den Wert der targetId-Eigenschaft erstellt haben
ID der Zuweisungsrichtlinie für den Wert der assignmentPolicyId-Eigenschaft
ID des Zugriffspakets für den Wert der accessPackageId-Eigenschaft
In der Antwort ist Accepted der status und ein Zustand ist Submitted. Notieren Sie sich den Wert der id-Eigenschaft, der zurückgegeben wird, um später die status der Anforderung abzurufen.
Starten Sie eine neue anonyme Browsersitzung, und melden Sie sich bei Requestor1 an. Dadurch unterbrechen Sie ihre aktuelle Administratorsitzung nicht. Alternativ können Sie Ihre aktuelle Administratorsitzung unterbrechen, indem Sie sich bei Graph Explorer abmelden und sich als Anforderer1 wieder anmelden.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageAssignmentRequest
{
RequestType = "UserAdd",
AccessPackageAssignment = new AccessPackageAssignment
{
TargetId = "007d1c7e-7fa8-4e33-b678-5e437acdcddc",
AssignmentPolicyId = "db440482-1210-4a60-9b55-3ac7a72f63ba",
AccessPackageId = "88203d16-0e31-41d4-87b2-dd402f1435e9",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentRequests.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageAssignmentRequest()
requestType := "UserAdd"
requestBody.SetRequestType(&requestType)
accessPackageAssignment := graphmodels.NewAccessPackageAssignment()
targetId := "007d1c7e-7fa8-4e33-b678-5e437acdcddc"
accessPackageAssignment.SetTargetId(&targetId)
assignmentPolicyId := "db440482-1210-4a60-9b55-3ac7a72f63ba"
accessPackageAssignment.SetAssignmentPolicyId(&assignmentPolicyId)
accessPackageId := "88203d16-0e31-41d4-87b2-dd402f1435e9"
accessPackageAssignment.SetAccessPackageId(&accessPackageId)
requestBody.SetAccessPackageAssignment(accessPackageAssignment)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageAssignmentRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageAssignmentRequests().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentRequest accessPackageAssignmentRequest = new AccessPackageAssignmentRequest();
accessPackageAssignmentRequest.setRequestType("UserAdd");
AccessPackageAssignment accessPackageAssignment = new AccessPackageAssignment();
accessPackageAssignment.setTargetId("007d1c7e-7fa8-4e33-b678-5e437acdcddc");
accessPackageAssignment.setAssignmentPolicyId("db440482-1210-4a60-9b55-3ac7a72f63ba");
accessPackageAssignment.setAccessPackageId("88203d16-0e31-41d4-87b2-dd402f1435e9");
accessPackageAssignmentRequest.setAccessPackageAssignment(accessPackageAssignment);
AccessPackageAssignmentRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentRequests().post(accessPackageAssignmentRequest);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageAssignmentRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageAssignment;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageAssignmentRequest();
$requestBody->setRequestType('UserAdd');
$accessPackageAssignment = new AccessPackageAssignment();
$accessPackageAssignment->setTargetId('007d1c7e-7fa8-4e33-b678-5e437acdcddc');
$accessPackageAssignment->setAssignmentPolicyId('db440482-1210-4a60-9b55-3ac7a72f63ba');
$accessPackageAssignment->setAccessPackageId('88203d16-0e31-41d4-87b2-dd402f1435e9');
$requestBody->setAccessPackageAssignment($accessPackageAssignment);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageAssignmentRequests()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_assignment_request import AccessPackageAssignmentRequest
from msgraph_beta.generated.models.access_package_assignment import AccessPackageAssignment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageAssignmentRequest(
request_type = "UserAdd",
access_package_assignment = AccessPackageAssignment(
target_id = "007d1c7e-7fa8-4e33-b678-5e437acdcddc",
assignment_policy_id = "db440482-1210-4a60-9b55-3ac7a72f63ba",
access_package_id = "88203d16-0e31-41d4-87b2-dd402f1435e9",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_assignment_requests.post(request_body)
Sie können sich jetzt abmelden und die anonyme Sitzung beenden.
Schritt 3: Überprüfen, ob der Zugriff zugewiesen wurde
In diesem Schritt bestätigen Sie, dass dem Benutzerkonto Requestor1 das Zugriffspaket zugewiesen wurde und dass sie jetzt Mitglied der Gruppe Marketingressourcen sind. Kehren Sie zur Administratorsitzung in Graph Explorer zurück.
Schritt 3.1: Abrufen der status der Anforderung
Verwenden Sie den Wert der id-Eigenschaft der Anforderung, um die aktuelle status abzurufen. In der Antwort sehen Sie, dass sich die status in Erfüllt und der Status in Übermittelt geändert hat.
GET https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignmentRequests/a6bb6942-3ae1-4259-9908-0133aaee9377
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentRequests["{accessPackageAssignmentRequest-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageAssignmentRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageAssignmentRequests().ByAccessPackageAssignmentRequestId("accessPackageAssignmentRequest-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentRequests().byAccessPackageAssignmentRequestId("{accessPackageAssignmentRequest-id}").get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity_governance.entitlement_management.access_package_assignment_requests.by_access_package_assignment_request_id('accessPackageAssignmentRequest-id').get()
Sie können auch die ID der Zugriffspaketrichtlinie verwenden, die Sie erstellt haben, um festzustellen, dass Ressourcen dem Benutzerkonto Requestor1 zugewiesen wurden.
GET https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignments?$filter=accessPackageAssignmentPolicy/Id eq 'db440482-1210-4a60-9b55-3ac7a72f63ba'&$expand=target,accessPackageAssignmentResourceRoles
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "accessPackageAssignmentPolicy/Id eq 'db440482-1210-4a60-9b55-3ac7a72f63ba'";
requestConfiguration.QueryParameters.Expand = new string []{ "target","accessPackageAssignmentResourceRoles" };
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/identitygovernance"
//other-imports
)
requestFilter := "accessPackageAssignmentPolicy/Id eq 'db440482-1210-4a60-9b55-3ac7a72f63ba'"
requestParameters := &graphidentitygovernance.IdentityGovernanceEntitlementManagementAccessPackageAssignmentsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
Expand: [] string {"target","accessPackageAssignmentResourceRoles"},
}
configuration := &graphidentitygovernance.IdentityGovernanceEntitlementManagementAccessPackageAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageAssignments, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageAssignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentCollectionResponse result = graphClient.identityGovernance().entitlementManagement().accessPackageAssignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "accessPackageAssignmentPolicy/Id eq 'db440482-1210-4a60-9b55-3ac7a72f63ba'";
requestConfiguration.queryParameters.expand = new String []{"target", "accessPackageAssignmentResourceRoles"};
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identity_governance.entitlement_management.access_package_assignments.access_package_assignments_request_builder import AccessPackageAssignmentsRequestBuilder
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 = AccessPackageAssignmentsRequestBuilder.AccessPackageAssignmentsRequestBuilderGetQueryParameters(
filter = "accessPackageAssignmentPolicy/Id eq 'db440482-1210-4a60-9b55-3ac7a72f63ba'",
expand = ["target","accessPackageAssignmentResourceRoles"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.entitlement_management.access_package_assignments.get(request_configuration = request_configuration)
Nachdem die Anforderung erteilt wurde, können Sie die ID verwenden, die Sie für die Gruppe Marketingressourcen notiert haben, um festzustellen, dass ihr das Benutzerkonto Requestor1 hinzugefügt wurde.
GET https://graph.microsoft.com/v1.0/groups/f4892fac-e81c-4712-bdf2-a4450008a4b0/members
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Groups["{group-id}"].Members.GetAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
members, err := graphClient.Groups().ByGroupId("group-id").Members().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DirectoryObjectCollectionResponse result = graphClient.groups().byGroupId("{group-id}").members().get();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.groups.by_group_id('group-id').members.get()
In diesem Schritt entfernen Sie die vorgenommenen Änderungen und löschen das Zugriffspaket für die Marketingkampagne .
Entfernen einer Zugriffspaketzuweisung
Sie müssen alle Zuweisungen zum Zugriffspaket entfernen, bevor Sie es löschen können. Verwenden Sie die ID der Zuweisungsanforderung, die Sie zuvor aufgezeichnet haben, um sie zu löschen.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new AccessPackageAssignmentRequest
{
RequestType = "AdminRemove",
AccessPackageAssignment = new AccessPackageAssignment
{
Id = "a6bb6942-3ae1-4259-9908-0133aaee9377",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentRequests.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAccessPackageAssignmentRequest()
requestType := "AdminRemove"
requestBody.SetRequestType(&requestType)
accessPackageAssignment := graphmodels.NewAccessPackageAssignment()
id := "a6bb6942-3ae1-4259-9908-0133aaee9377"
accessPackageAssignment.SetId(&id)
requestBody.SetAccessPackageAssignment(accessPackageAssignment)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
accessPackageAssignmentRequests, err := graphClient.IdentityGovernance().EntitlementManagement().AccessPackageAssignmentRequests().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AccessPackageAssignmentRequest accessPackageAssignmentRequest = new AccessPackageAssignmentRequest();
accessPackageAssignmentRequest.setRequestType("AdminRemove");
AccessPackageAssignment accessPackageAssignment = new AccessPackageAssignment();
accessPackageAssignment.setId("a6bb6942-3ae1-4259-9908-0133aaee9377");
accessPackageAssignmentRequest.setAccessPackageAssignment(accessPackageAssignment);
AccessPackageAssignmentRequest result = graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentRequests().post(accessPackageAssignmentRequest);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageAssignmentRequest;
use Microsoft\Graph\Beta\Generated\Models\AccessPackageAssignment;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AccessPackageAssignmentRequest();
$requestBody->setRequestType('AdminRemove');
$accessPackageAssignment = new AccessPackageAssignment();
$accessPackageAssignment->setId('a6bb6942-3ae1-4259-9908-0133aaee9377');
$requestBody->setAccessPackageAssignment($accessPackageAssignment);
$result = $graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageAssignmentRequests()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.access_package_assignment_request import AccessPackageAssignmentRequest
from msgraph_beta.generated.models.access_package_assignment import AccessPackageAssignment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AccessPackageAssignmentRequest(
request_type = "AdminRemove",
access_package_assignment = AccessPackageAssignment(
id = "a6bb6942-3ae1-4259-9908-0133aaee9377",
),
)
result = await graph_client.identity_governance.entitlement_management.access_package_assignment_requests.post(request_body)
Verwenden Sie die ID der Zuweisungsrichtlinie, die Sie zuvor notiert haben, um sie zu löschen. Stellen Sie sicher, dass zuerst alle Zuweisungen entfernt werden. Die Anforderung gibt einen 204 No Content Antwortcode zurück.
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentPolicies["{accessPackageAssignmentPolicy-id}"].DeleteAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityGovernance().EntitlementManagement().AccessPackageAssignmentPolicies().ByAccessPackageAssignmentPolicyId("accessPackageAssignmentPolicy-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentPolicies().byAccessPackageAssignmentPolicyId("{accessPackageAssignmentPolicy-id}").delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageAssignmentPolicies()->byAccessPackageAssignmentPolicyId('accessPackageAssignmentPolicy-id')->delete()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.identity_governance.entitlement_management.access_package_assignment_policies.by_access_package_assignment_policy_id('accessPackageAssignmentPolicy-id').delete()
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.EntitlementManagement.AccessPackages["{accessPackage-id}"].DeleteAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityGovernance().EntitlementManagement().AccessPackages().ByAccessPackageId("accessPackage-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.identityGovernance().entitlementManagement().accessPackages().byAccessPackageId("{accessPackage-id}").delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->identityGovernance()->entitlementManagement()->accessPackages()->byAccessPackageId('accessPackage-id')->delete()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.identity_governance.entitlement_management.access_packages.by_access_package_id('accessPackage-id').delete()
In diesem Tutorial waren die Marketingkampagnenressourcen Mitglied einer einzelnen Gruppe, die Zugriff auf andere Ressourcen haben könnte. Die Ressourcen können auch eine Sammlung von Gruppen, Anwendungen oder SharePoint Online-Websites sein.
Die Funktionen in diesem Tutorial werden in Microsoft Entra ID P2- oder Microsoft Entra ID Governance-Lizenzen unterstützt. Andere erweiterte Berechtigungsverwaltungsfunktionen erfordern jedoch eine zusätzliche Lizenzierung. Weitere Informationen finden Sie unter Microsoft Entra ID Governance Lizenzierungsgrundlagen.