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.
Update an attack simulation campaign for a tenant.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
In the request body, supply only the values for properties that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
The social engineering technique used in the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, credentialHarvesting, attachmentMalware, driveByUrl, linkInAttachment, linkToMalwareFile, unknownFutureValue. For more information on the types of social engineering attack techniques, see simulations.
Attack type of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, social, cloud, endpoint, unknownFutureValue.
completionDateTime
DateTimeOffset
Date and time of completion of the attack simulation and training campaign. Supports $filter and $orderby.
description
String
Description of the attack simulation and training campaign.
displayName
String
Display name of the attack simulation and training campaign. Supports $filter and $orderby.
Identity of the user who most recently modified the attack simulation and training campaign.
lastModifiedDateTime
DateTimeOffset
Date and time of the most recent modification of the attack simulation and training campaign.
launchDateTime
DateTimeOffset
Date and time of the launch/start of the attack simulation and training campaign. Supports $filter and $orderby.
payloadDeliveryPlatform
payloadDeliveryPlatform
Method of delivery of the phishing payload used in the attack simulation and training campaign. Possible values are: unknown, sms, email, teams, unknownFutureValue.
Status of the attack simulation and training campaign. Supports $filter and $orderby. Possible values are: unknown, draft, running, scheduled, succeeded, failed, cancelled, excluded, unknownFutureValue.
Response
If successful, this method returns a 202 Accepted response code and a tracking header named location in the response.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var simulation = new Simulation
{
Id = "2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc",
DisplayName = "Graph Simulation",
Description = "Test simulation created using postman",
PayloadDeliveryPlatform = PayloadDeliveryPlatform.Email,
DurationInDays = 7,
AttackTechnique = SimulationAttackTechnique.CredentialHarvesting,
AttackType = SimulationAttackType.Social,
Status = SimulationStatus.Scheduled,
CompletionDateTime = DateTimeOffset.Parse("2022-09-16T06:13:08.4297612Z"),
LaunchDateTime = DateTimeOffset.Parse("2022-09-05T06:13:08.4297612Z"),
IncludedAccountTarget = new AddressBookAccountTargetContent
{
Type = AccountTargetContentType.AddressBook,
AccountTargetEmails = new List<String>()
{
"faiza@contoso.com"
}
},
ExcludedAccountTarget = new AddressBookAccountTargetContent
{
Type = AccountTargetContentType.AddressBook,
AccountTargetEmails = new List<String>()
{
"sam@contoso.com"
}
},
AdditionalData = new Dictionary<string, object>()
{
{"payload@odata.bind", "https://graph.microsoft.com/beta/security/attacksimulation/payloads/12345678-9abc-def0-123456789a"}
}
};
await graphClient.Security.AttackSimulation.Simulations["{simulation-id}"]
.Request()
.UpdateAsync(simulation);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Simulation();
$requestBody->setId('2f5548d1-0dd8-4cc8-9de0-e0d6ec7ea3dc');
$requestBody->setDisplayName('Graph Simulation');
$requestBody->setDescription('Test simulation created using postman');
$requestBody->setPayloadDeliveryPlatform(new PayloadDeliveryPlatform('email'));
$requestBody->setDurationInDays(7);
$requestBody->setAttackTechnique(new SimulationAttackTechnique('credentialharvesting'));
$requestBody->setAttackType(new SimulationAttackType('social'));
$requestBody->setStatus(new SimulationStatus('scheduled'));
$requestBody->setCompletionDateTime(new DateTime('2022-09-16T06:13:08.4297612Z'));
$requestBody->setLaunchDateTime(new DateTime('2022-09-05T06:13:08.4297612Z'));
$includedAccountTarget = new AccountTargetContent();
$includedAccountTarget->set@odatatype('#microsoft.graph.addressBookAccountTargetContent');
$includedAccountTarget->setType(new AccountTargetContentType('addressbook'));
$additionalData = [
'accountTargetEmails' => ['faiza@contoso.com', ],
];
$includedAccountTarget->setAdditionalData($additionalData);
$requestBody->setIncludedAccountTarget($includedAccountTarget);
$excludedAccountTarget = new AccountTargetContent();
$excludedAccountTarget->set@odatatype('#microsoft.graph.addressBookAccountTargetContent');
$excludedAccountTarget->setType(new AccountTargetContentType('addressbook'));
$additionalData = [
'accountTargetEmails' => ['sam@contoso.com', ],
];
$excludedAccountTarget->setAdditionalData($additionalData);
$requestBody->setExcludedAccountTarget($excludedAccountTarget);
$additionalData = [
'payload@odata.bind' => 'https://graph.microsoft.com/beta/security/attacksimulation/payloads/12345678-9abc-def0-123456789a',
];
$requestBody->setAdditionalData($additionalData);
$requestResult = $graphServiceClient->security()->attackSimulation()->simulationsById('simulation-id')->patch($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.