命名空间:microsoft.graph.security
更新 healthIssue 对象的属性。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
✅ |
✅ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
SecurityIdentitiesHealth.ReadWrite.All |
不可用。 |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
SecurityIdentitiesHealth.ReadWrite.All |
不可用。 |
HTTP 请求
PATCH /security/identities/healthIssues/{healthIssueId}
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type |
application/json. 必需。 |
请求正文
在请求正文中, 仅 提供要更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者根据对其他属性值的更改重新计算。
下表指定可更新的属性。
| 属性 |
类型 |
说明 |
| status |
microsoft.graph.security.healthIssueStatus |
运行状况问题的状态。 可能的值包括 open、closed、suppressed、unknownFutureValue。 |
响应
如果成功,此方法在 200 OK 响应正文中返回响应代码和更新的 microsoft.graph.security.healthIssue 对象。
示例
请求
以下示例显示了一个请求。
PATCH https://graph.microsoft.com/v1.0/security/identities/healthIssues/b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c
Content-Type: application/json
{
"status": "closed"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.Security;
var requestBody = new HealthIssue
{
Status = HealthIssueStatus.Closed,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Identities.HealthIssues["{healthIssue-id}"].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"
graphmodelssecurity "github.com/microsoftgraph/msgraph-sdk-go/models/security"
//other-imports
)
requestBody := graphmodelssecurity.NewHealthIssue()
status := graphmodels.CLOSED_HEALTHISSUESTATUS
requestBody.SetStatus(&status)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
healthIssues, err := graphClient.Security().Identities().HealthIssues().ByHealthIssueId("healthIssue-id").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.security.HealthIssue healthIssue = new com.microsoft.graph.models.security.HealthIssue();
healthIssue.setStatus(com.microsoft.graph.models.security.HealthIssueStatus.Closed);
com.microsoft.graph.models.security.HealthIssue result = graphClient.security().identities().healthIssues().byHealthIssueId("{healthIssue-id}").patch(healthIssue);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const healthIssue = {
status: 'closed'
};
await client.api('/security/identities/healthIssues/b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c')
.update(healthIssue);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Security\HealthIssue;
use Microsoft\Graph\Generated\Models\Security\HealthIssueStatus;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new HealthIssue();
$requestBody->setStatus(new HealthIssueStatus('closed'));
$result = $graphServiceClient->security()->identities()->healthIssues()->byHealthIssueId('healthIssue-id')->patch($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Security
$params = @{
status = "closed"
}
Update-MgSecurityIdentityHealthIssue -HealthIssueId $healthIssueId -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.security.health_issue import HealthIssue
from msgraph.generated.models.health_issue_status import HealthIssueStatus
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = HealthIssue(
status = HealthIssueStatus.Closed,
)
result = await graph_client.security.identities.health_issues.by_health_issue_id('healthIssue-id').patch(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.security.healthIssue",
"additionalInformation": ["Descendant User Objects (Schema-Id-Guid: bf967aba-0de6-11d0-a285-00aa003049e2)"],
"createdDateTime": "2022-07-15T12:19:27.7211305Z",
"description": "Directory Services Object Auditing isn't configured as required on domain1.contoso.com",
"displayName": "Directory Services Object Auditing isn't configured as required",
"domainNames": ["domain1.contoso.com", "domain2.contoso.com"],
"healthIssueType": "Global",
"id": "b3c1b5fc-828c-45fa-a1e1-10d74f6d6e9c",
"issueTypeId": "1031",
"lastModifiedDateTime": "2022-07-15T12:19:27.7211305Z",
"recommendations": ["Please configure the Directory Services Object Auditing events according to the guidance as described in https://aka.ms/mdi/objectauditing"],
"recommendedActionCommands": ["Import-Module DefenderForIdentity"],
"sensorDNSNames": ["DC1.domain1.contoso.com", "DC2.domain2.contoso.com"],
"severity": "medium",
"status": "closed"
}