更新 secureScoreControlProfiles
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
更新任何集成解决方案中的可编辑 secureScoreControlProfiles 属性,以更改各种属性,例如 assignedTo 或 tenantNote 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
SecurityEvents.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
SecurityEvents.ReadWrite.All
HTTP 请求
PATCH /security/secureScoreControlProfiles/{id}
名称
说明
Authorization
Bearer {code}。 必需。
Prefer
return=representation。
请求正文
在请求正文中,提供应更新的相关字段值的 JSON 表示形式。 下表列出了可针对 secureScoreControlProfile 更新的字段。 请求正文中不包含的现有属性的值不会更改。 为了获得最佳性能,请勿加入尚未更改的现有值。
属性
类型
说明
assignedTo
String
分配了该控件的分析员的姓名,用于会审、实施或修正。
tenantNote
String
针对客户控制管理的 (分析员意见) 。
controlStateUpdates
String
分析员驱动的控件设置。 可取值为:ignore、thirdParty、reviewed。
响应
如果成功,此方法返回 204 No Content 响应代码。
如果使用可选请求标头,则该方法在响应正文中返回 响应代码和更新的 200 OK secureScoreControlProfiles 对象。
示例
请求
下面展示了示例请求。
PATCH https://graph.microsoft.com/beta/security/secureScoreControlProfiles/AdminMFA
Content-type: application/json
{
"controlStateUpdates": "controlStateUpdates-value"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var secureScoreControlProfile = new SecureScoreControlProfile
{
ControlStateUpdates = "controlStateUpdates-value"
};
await graphClient.Security.SecureScoreControlProfiles["{secureScoreControlProfile-id}"]
.Request()
.UpdateAsync(secureScoreControlProfile);
const options = {
authProvider,
};
const client = Client.init(options);
const secureScoreControlProfile = {
controlStateUpdates: 'controlStateUpdates-value'
};
await client.api('/security/secureScoreControlProfiles/AdminMFA')
.version('beta')
.update(secureScoreControlProfile);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/security/secureScoreControlProfiles/AdminMFA"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphSecureScoreControlProfile *secureScoreControlProfile = [[MSGraphSecureScoreControlProfile alloc] init];
[secureScoreControlProfile setControlStateUpdates:@"controlStateUpdates-value"];
NSError *error;
NSData *secureScoreControlProfileData = [secureScoreControlProfile getSerializedDataWithError:&error];
[urlRequest setHTTPBody:secureScoreControlProfileData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SecureScoreControlProfile secureScoreControlProfile = new SecureScoreControlProfile();
secureScoreControlProfile.controlStateUpdates = "controlStateUpdates-value";
graphClient.security().secureScoreControlProfiles("AdminMFA")
.buildRequest()
.patch(secureScoreControlProfile);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewSecureScoreControlProfile()
controlStateUpdates := "controlStateUpdates-value"
requestBody.SetControlStateUpdates(&controlStateUpdates)
secureScoreControlProfileId := "secureScoreControlProfile-id"
graphClient.Security().SecureScoreControlProfilesById(&secureScoreControlProfileId).Patch(requestBody)
Import-Module Microsoft.Graph.Security
$params = @{
ControlStateUpdates = "controlStateUpdates-value"
}
Update-MgSecuritySecureScoreControlProfile -SecureScoreControlProfileId $secureScoreControlProfileId -BodyParameter $params
响应
下面是成功响应的示例。
HTTP/1.1 204 No Content