命名空间:microsoft.graph.identityGovernance
更新 lifecycleManagementSettings 对象的属性。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
✅ |
✅ |
✅ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
LifecycleWorkflows.ReadWrite.All |
不可用。 |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
LifecycleWorkflows.ReadWrite.All |
不可用。 |
重要
在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。
生命周期工作流管理员 是此作支持的最低特权角色。
HTTP 请求
PATCH /identityGovernance/lifecycleWorkflows/settings
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type |
application/json. 必需。 |
请求正文
在请求正文中, 仅 提供要更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者根据对其他属性值的更改重新计算。
下表指定可更新的属性。
响应
如果成功,此操作返回 204 No Content 响应代码。
示例
请求
以下示例显示了一个请求。
PATCH https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/settings
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity",
"workflowScheduleIntervalInHours": 3,
"emailSettings": {
"senderDomain": "ContosoIndustries.net",
"useCompanyBranding": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.IdentityGovernance;
using Microsoft.Graph.Models;
var requestBody = new LifecycleManagementSettings
{
WorkflowScheduleIntervalInHours = 3,
EmailSettings = new EmailSettings
{
SenderDomain = "ContosoIndustries.net",
UseCompanyBranding = true,
},
AdditionalData = new Dictionary<string, object>
{
{
"@odata.context" , "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Settings.PatchAsync(requestBody);
有关如何将 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"
graphmodelsidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/models/identitygovernance"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodelsidentitygovernance.NewLifecycleManagementSettings()
workflowScheduleIntervalInHours := int32(3)
requestBody.SetWorkflowScheduleIntervalInHours(&workflowScheduleIntervalInHours)
emailSettings := graphmodels.NewEmailSettings()
senderDomain := "ContosoIndustries.net"
emailSettings.SetSenderDomain(&senderDomain)
useCompanyBranding := true
emailSettings.SetUseCompanyBranding(&useCompanyBranding)
requestBody.SetEmailSettings(emailSettings)
additionalData := map[string]interface{}{
"@odata.context" : "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
settings, err := graphClient.IdentityGovernance().LifecycleWorkflows().Settings().Patch(context.Background(), requestBody, nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.identitygovernance.LifecycleManagementSettings lifecycleManagementSettings = new com.microsoft.graph.models.identitygovernance.LifecycleManagementSettings();
lifecycleManagementSettings.setWorkflowScheduleIntervalInHours(3);
EmailSettings emailSettings = new EmailSettings();
emailSettings.setSenderDomain("ContosoIndustries.net");
emailSettings.setUseCompanyBranding(true);
lifecycleManagementSettings.setEmailSettings(emailSettings);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@odata.context", "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity");
lifecycleManagementSettings.setAdditionalData(additionalData);
com.microsoft.graph.models.identitygovernance.LifecycleManagementSettings result = graphClient.identityGovernance().lifecycleWorkflows().settings().patch(lifecycleManagementSettings);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const lifecycleManagementSettings = {
'@odata.context': 'https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity',
workflowScheduleIntervalInHours: 3,
emailSettings: {
senderDomain: 'ContosoIndustries.net',
useCompanyBranding: true
}
};
await client.api('/identityGovernance/lifecycleWorkflows/settings')
.update(lifecycleManagementSettings);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\IdentityGovernance\LifecycleManagementSettings;
use Microsoft\Graph\Generated\Models\EmailSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new LifecycleManagementSettings();
$requestBody->setWorkflowScheduleIntervalInHours(3);
$emailSettings = new EmailSettings();
$emailSettings->setSenderDomain('ContosoIndustries.net');
$emailSettings->setUseCompanyBranding(true);
$requestBody->setEmailSettings($emailSettings);
$additionalData = [
'@odata.context' => 'https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->settings()->patch($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
$params = @{
"@odata.context" = "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity"
workflowScheduleIntervalInHours = 3
emailSettings = @{
senderDomain = "ContosoIndustries.net"
useCompanyBranding = $true
}
}
Update-MgIdentityGovernanceLifecycleWorkflowSetting -BodyParameter $params
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.identity_governance.lifecycle_management_settings import LifecycleManagementSettings
from msgraph.generated.models.email_settings import EmailSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = LifecycleManagementSettings(
workflow_schedule_interval_in_hours = 3,
email_settings = EmailSettings(
sender_domain = "ContosoIndustries.net",
use_company_branding = True,
),
additional_data = {
"@odata_context" : "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/settings/$entity",
}
)
result = await graph_client.identity_governance.lifecycle_workflows.settings.patch(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
HTTP/1.1 204 No Content