Namespace: microsoft.graph.identityGovernance
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Run a workflow object on-demand with a specific scope. You can run any workflow on-demand, including scheduled workflows. Workflows created from the "Real-time employee termination" template are run on-demand only. When you run a workflow on demand, the tasks are executed regardless of whether the user state matches the scope and trigger execution conditions.
This API is available in the following national cloud deployments.
| Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
LifecycleWorkflows-Workflow.Activate |
LifecycleWorkflows-Workflow.ReadWrite.All, LifecycleWorkflows.ReadWrite.All |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
LifecycleWorkflows-Workflow.Activate |
LifecycleWorkflows-Workflow.ReadWrite.All, LifecycleWorkflows.ReadWrite.All |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Lifecycle Workflows Administrator is the least privileged role supported for this operation.
HTTP request
POST /identityGovernance/lifecycleWorkflows/workflows/{workflowId}/activatewithscope
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that are required with this action.
| Parameter |
Type |
Description |
| subjects |
microsoft.graph.user collection |
The subjects for whom the workflow is activated. |
Response
If successful, this action returns a 204 No Content response code.
Examples
Example 1: Activate a workflow with a specific scope of 2 users
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341/activatewithscope
Content-Type: application/json
{
"subjects": [
{ "id": "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"},
{ "id": "ea09ac2e-77e3-4134-85f2-25ccf3c33387"}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceActivateWithScope;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new ActivateWithScopePostRequestBody
{
AdditionalData = new Dictionary<string, object>
{
{
"subjects" , new List<object>
{
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"id", new UntypedString("8cdf25a8-c9d2-423e-a03d-3f39f03c3e97")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"id", new UntypedString("ea09ac2e-77e3-4134-85f2-25ccf3c33387")
},
}),
}
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceActivateWithScope.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody activateWithScopePostRequestBody = new com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
LinkedList<Object> subjects = new LinkedList<Object>();
property = new ();
property.setId("8cdf25a8-c9d2-423e-a03d-3f39f03c3e97");
subjects.add(property);
property1 = new ();
property1.setId("ea09ac2e-77e3-4134-85f2-25ccf3c33387");
subjects.add(property1);
additionalData.put("subjects", subjects);
activateWithScopePostRequestBody.setAdditionalData(additionalData);
graphClient.identityGovernance().lifecycleWorkflows().workflows().byWorkflowId("{workflow-id}").microsoftGraphIdentityGovernanceActivateWithScope().post(activateWithScopePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const activatewithscope = {
subjects: [
{ id: '8cdf25a8-c9d2-423e-a03d-3f39f03c3e97'},
{ id: 'ea09ac2e-77e3-4134-85f2-25ccf3c33387'}
]
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/14879e66-9ea9-48d0-804d-8fea672d0341/activatewithscope')
.version('beta')
.post(activatewithscope);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\Item\MicrosoftGraphIdentityGovernanceActivateWithScope\ActivateWithScopePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ActivateWithScopePostRequestBody();
$additionalData = [
'subjects' => [
[
'id' => '8cdf25a8-c9d2-423e-a03d-3f39f03c3e97',
],
[
'id' => 'ea09ac2e-77e3-4134-85f2-25ccf3c33387',
],
],
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceActivateWithScope()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
subjects = @(
@{
id = "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97"
}
@{
id = "ea09ac2e-77e3-4134-85f2-25ccf3c33387"
}
)
}
Initialize-MgBetaIdentityGovernanceLifecycleWorkflowWithScope -WorkflowId $workflowId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identitygovernance.lifecycleworkflows.workflows.item.microsoft_graph_identity_governance_activate_with_scope.activate_with_scope_post_request_body import ActivateWithScopePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ActivateWithScopePostRequestBody(
additional_data = {
"subjects" : [
{
"id" : "8cdf25a8-c9d2-423e-a03d-3f39f03c3e97",
},
{
"id" : "ea09ac2e-77e3-4134-85f2-25ccf3c33387",
},
],
}
)
await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_activate_with_scope.post(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content
Example 2: Activate a workflow with a specific scope of 2 users who don't exist
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/2f0dcb02-65d9-4369-bad5-a3174538c5ff/activatewithscope
Content-Type: application/json
{
"scope": {
"@odata.type": "microsoft.graph.identityGovernance.activateProcessingResultScope",
"processingResults": [
{
"id": "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa"
},
{
"id": "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb"
}
],
"taskScope": "allTasks"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceActivateWithScope;
using Microsoft.Graph.Beta.Models.IdentityGovernance;
var requestBody = new ActivateWithScopePostRequestBody
{
Scope = new ActivateProcessingResultScope
{
OdataType = "microsoft.graph.identityGovernance.activateProcessingResultScope",
ProcessingResults = new List<UserProcessingResult>
{
new UserProcessingResult
{
Id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa",
},
new UserProcessingResult
{
Id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb",
},
},
TaskScope = ActivationTaskScopeType.AllTasks,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceActivateWithScope.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"
graphidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/identitygovernance"
graphmodelsidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/models/identitygovernance"
//other-imports
)
requestBody := graphidentitygovernance.NewActivateWithScopePostRequestBody()
scope := graphmodelsidentitygovernance.NewActivateProcessingResultScope()
userProcessingResult := graphmodelsidentitygovernance.NewUserProcessingResult()
id := "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa"
userProcessingResult.SetId(&id)
userProcessingResult1 := graphmodelsidentitygovernance.NewUserProcessingResult()
id := "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb"
userProcessingResult1.SetId(&id)
processingResults := []graphmodelsidentitygovernance.UserProcessingResultable {
userProcessingResult,
userProcessingResult1,
}
scope.SetProcessingResults(processingResults)
taskScope := graphmodels.ALLTASKS_ACTIVATIONTASKSCOPETYPE
scope.SetTaskScope(&taskScope)
requestBody.SetScope(scope)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityGovernance().LifecycleWorkflows().Workflows().ByWorkflowId("workflow-id").MicrosoftGraphIdentityGovernanceActivateWithScope().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody activateWithScopePostRequestBody = new com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody();
com.microsoft.graph.beta.models.identitygovernance.ActivateProcessingResultScope scope = new com.microsoft.graph.beta.models.identitygovernance.ActivateProcessingResultScope();
scope.setOdataType("microsoft.graph.identityGovernance.activateProcessingResultScope");
LinkedList<com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult> processingResults = new LinkedList<com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult>();
com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult userProcessingResult = new com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult();
userProcessingResult.setId("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa");
processingResults.add(userProcessingResult);
com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult userProcessingResult1 = new com.microsoft.graph.beta.models.identitygovernance.UserProcessingResult();
userProcessingResult1.setId("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb");
processingResults.add(userProcessingResult1);
scope.setProcessingResults(processingResults);
scope.setTaskScope(com.microsoft.graph.beta.models.identitygovernance.ActivationTaskScopeType.AllTasks);
activateWithScopePostRequestBody.setScope(scope);
graphClient.identityGovernance().lifecycleWorkflows().workflows().byWorkflowId("{workflow-id}").microsoftGraphIdentityGovernanceActivateWithScope().post(activateWithScopePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const activatewithscope = {
scope: {
'@odata.type': 'microsoft.graph.identityGovernance.activateProcessingResultScope',
processingResults: [
{
id: 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa'
},
{
id: 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb'
}
],
taskScope: 'allTasks'
}
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/2f0dcb02-65d9-4369-bad5-a3174538c5ff/activatewithscope')
.version('beta')
.post(activatewithscope);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\Item\MicrosoftGraphIdentityGovernanceActivateWithScope\ActivateWithScopePostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\ActivateProcessingResultScope;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\UserProcessingResult;
use Microsoft\Graph\Beta\Generated\Models\IdentityGovernance\ActivationTaskScopeType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ActivateWithScopePostRequestBody();
$scope = new ActivateProcessingResultScope();
$scope->setOdataType('microsoft.graph.identityGovernance.activateProcessingResultScope');
$processingResultsUserProcessingResult1 = new UserProcessingResult();
$processingResultsUserProcessingResult1->setId('abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa');
$processingResultsArray []= $processingResultsUserProcessingResult1;
$processingResultsUserProcessingResult2 = new UserProcessingResult();
$processingResultsUserProcessingResult2->setId('abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb');
$processingResultsArray []= $processingResultsUserProcessingResult2;
$scope->setProcessingResults($processingResultsArray);
$scope->setTaskScope(new ActivationTaskScopeType('allTasks'));
$requestBody->setScope($scope);
$graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceActivateWithScope()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
scope = @{
"@odata.type" = "microsoft.graph.identityGovernance.activateProcessingResultScope"
processingResults = @(
@{
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa"
}
@{
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb"
}
)
taskScope = "allTasks"
}
}
Initialize-MgBetaIdentityGovernanceLifecycleWorkflowWithScope -WorkflowId $workflowId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identitygovernance.lifecycleworkflows.workflows.item.microsoft_graph_identity_governance_activate_with_scope.activate_with_scope_post_request_body import ActivateWithScopePostRequestBody
from msgraph_beta.generated.models.identity_governance.activate_processing_result_scope import ActivateProcessingResultScope
from msgraph_beta.generated.models.identity_governance.user_processing_result import UserProcessingResult
from msgraph_beta.generated.models.activation_task_scope_type import ActivationTaskScopeType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ActivateWithScopePostRequestBody(
scope = ActivateProcessingResultScope(
odata_type = "microsoft.graph.identityGovernance.activateProcessingResultScope",
processing_results = [
UserProcessingResult(
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa",
),
UserProcessingResult(
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb",
),
],
task_scope = ActivationTaskScopeType.AllTasks,
),
)
await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_activate_with_scope.post(request_body)
Response
The following example shows the response.
HTTP/1.1 406 NOT Acceptable
Example 3: Activate a workflow with a specific processing result scope
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/identityGovernance/lifecycleWorkflows/workflows/2f0dcb02-65d9-4369-bad5-a3174538c5ff/activatewithscope
Content-Type: application/json
{
"subjects": [
{
"id": "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa"
},
{
"id": "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceActivateWithScope;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new ActivateWithScopePostRequestBody
{
AdditionalData = new Dictionary<string, object>
{
{
"subjects" , new List<object>
{
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"id", new UntypedString("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"id", new UntypedString("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb")
},
}),
}
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceActivateWithScope.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody activateWithScopePostRequestBody = new com.microsoft.graph.beta.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivatewithscope.ActivateWithScopePostRequestBody();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
LinkedList<Object> subjects = new LinkedList<Object>();
property = new ();
property.setId("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa");
subjects.add(property);
property1 = new ();
property1.setId("abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb");
subjects.add(property1);
additionalData.put("subjects", subjects);
activateWithScopePostRequestBody.setAdditionalData(additionalData);
graphClient.identityGovernance().lifecycleWorkflows().workflows().byWorkflowId("{workflow-id}").microsoftGraphIdentityGovernanceActivateWithScope().post(activateWithScopePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const activatewithscope = {
subjects: [
{
id: 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa'
},
{
id: 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb'
}
]
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/2f0dcb02-65d9-4369-bad5-a3174538c5ff/activatewithscope')
.version('beta')
.post(activatewithscope);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\Item\MicrosoftGraphIdentityGovernanceActivateWithScope\ActivateWithScopePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ActivateWithScopePostRequestBody();
$additionalData = [
'subjects' => [
[
'id' => 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa',
],
[
'id' => 'abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb',
],
],
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceActivateWithScope()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
$params = @{
subjects = @(
@{
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa"
}
@{
id = "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb"
}
)
}
Initialize-MgBetaIdentityGovernanceLifecycleWorkflowWithScope -WorkflowId $workflowId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identitygovernance.lifecycleworkflows.workflows.item.microsoft_graph_identity_governance_activate_with_scope.activate_with_scope_post_request_body import ActivateWithScopePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ActivateWithScopePostRequestBody(
additional_data = {
"subjects" : [
{
"id" : "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_638927021459371237_0cdd8963-aaaa-4632-a1f2-aaaa7230aaaa",
},
{
"id" : "abc12345-265a-4e8f-8d61-94a2dcd2d395_1_78799042-265a-4e8f-8d61-94a2dcd2d395_388131231459357126_aaaa8963-1c30-4632-aaaa-ac96723069cb",
},
],
}
)
await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_activate_with_scope.post(request_body)
Response
The following example shows the response.
HTTP/1.1 204 No Content