Deploy Attack Simulation Training in Microsoft Defender for Office 365 Plan 2 to launch credential harvest, phishing, and social engineering simulations. Assign targeted training modules, build recurring automated campaigns, and measure security awareness improvements across your organization.
Attack Simulation Training is a built-in feature of Microsoft Defender for Office 365 Plan 2 that lets security teams run realistic phishing and social engineering simulations against their own users. It supports five social engineering techniques: Credential Harvest (fake sign-in pages), Malware Attachment, Link in Attachment, Link to Malware, and Drive-by URL.
When users fail a simulation (click a phishing link or enter credentials), they are automatically assigned training modules from Microsoft’s content library covering topics like phishing awareness, password hygiene, and safe browsing. Simulation Automations allow you to schedule recurring campaigns with payload rotation so users are tested continuously. not just once per quarter. This lab walks you through configuring simulations end-to-end: selecting techniques, customizing payloads, targeting user groups, launching campaigns, analysing results, and building a long-term awareness programme.
Contoso Financial, a 3,000-employee financial services firm, must satisfy NIST 800-53 SA-11 and ISO 27001 Annex A.7.2.2 requirements for ongoing security awareness training. The company’s current phishing click rate is 28% based on a recent third-party assessment. well above the industry benchmark of 15%. After a real-world BEC attack cost the company $240,000, the CISO has mandated monthly phishing simulations and targeted training for repeat offenders.
Success criteria: reduce click rate below 10% within 6 months, 95% training completion, automated monthly campaigns running without manual intervention, executive-level reporting dashboards.
Over 90% of successful cyber attacks begin with a phishing email. technology alone cannot eliminate this risk. Regulations including PCI-DSS, HIPAA, SOX, NIST 800-53, and ISO 27001 require periodic security awareness training and testing. Organizations running monthly simulations consistently reduce phishing click rates by 60-80% within 12 months.
The average cost of a BEC attack is $125,000+. Attack Simulation Training is included with the E5 licence at no additional cost. Simulations combined with immediate training create a feedback loop that changes user behaviour far more effectively than annual awareness presentations.
Open the Microsoft Defender portal at security.microsoft.com and navigate to Email & collaboration → Attack simulation training. The dashboard presents three main tabs:
Review the Recommended actions panel on the Overview tab. Microsoft provides guidance based on your simulation history and user vulnerability data. If this is your first time, the panel will recommend creating your first simulation.
# Connect to Exchange Online to verify Attack Simulation Training prerequisites
Connect-ExchangeOnline
# Verify that the Attack Simulation Administrator role is assigned
Get-ManagementRoleAssignment -RoleAssignee (Get-Mailbox -Identity $env:USERNAME).PrimarySmtpAddress |
Where-Object { $_.Role -like "*Attack*" } |
Format-Table Role, RoleAssignee -AutoSize
# Check that target mailboxes are cloud-hosted
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize 10 |
Select-Object DisplayName, PrimarySmtpAddress, RecipientTypeDetails |
Format-Table -AutoSizeBefore launching any simulation, configure Advanced Delivery so that phishing simulation emails bypass MDO filters and reach user inboxes. Without this, your own security stack will quarantine the simulation emails.
# WHAT: View current Advanced Delivery configuration for phishing simulation bypass
# WHY: Attack Simulation Training emails must bypass MDO filters (Safe Links, Safe Attachments,
# anti-spam, anti-phishing) to reach user inboxes. Without Advanced Delivery, your own
# security stack will quarantine the simulation emails, making the campaign fail.
# OUTPUT:
# - PhishSimOverridePolicy: The policy object (should exist and be enabled)
# - PhishSimOverrideRule: Lists allowed sending domains and IP ranges for simulations
# If empty, simulations will be blocked by MDO filters.
# View current Advanced Delivery configuration
Get-PhishSimOverridePolicy | Format-List
# View phishing simulation override rules (domains and IPs allowed to bypass filters)
Get-PhishSimOverrideRule | Format-List
# If no override policy exists, create one (required for third-party simulation tools)
# Microsoft-native simulations are automatically registered; third-party tools need manual config
New-PhishSimOverridePolicy -Name "Phishing Simulation Override"
# Add sending domains and IPs for third-party simulation tools
# Domains: The From address domain used by the simulation platform
# SenderIpRanges: The mail server IPs of the simulation platform (CIDR notation)
New-PhishSimOverrideRule -Name "Simulation Domains" `
-Policy "Phishing Simulation Override" `
-Domains "simulation.contoso.com","phishtest.contoso.com" `
-SenderIpRanges "203.0.113.0/24"Before creating a simulation, plan your campaign strategy. Consider these dimensions:
Document your campaign plan with target click-rate goals. For a first simulation, expect 20-30% click rates. Target reducing this to below 10% within 6 months through repeated simulations with targeted training.
Navigate to Simulations and click Launch a simulation. Walk through the wizard:
Review the summary and click Submit. The simulation enters the Queued state and begins sending within minutes.
For more realistic simulations, create custom payloads tailored to your organization. Navigate to Content library → Payloads and click Create a payload:
#{phishingUrl}# dynamic tag where you want the phishing link to appear in your email templateAlso create custom end-user notifications under Content library → End user notifications. These are emails sent to users after they complete (or fail to complete) assigned training.
<!-- Sample payload email body for IT Password Reset theme -->
<p>Dear #{userName}#,</p>
<p>Your Microsoft 365 password will expire in <strong>24 hours</strong>.
To avoid losing access to your email, Teams, and OneDrive,
please update your password immediately.</p>
<p><a href="#{phishingUrl}#" style="background:#0078D4;color:#fff;
padding:10px 24px;text-decoration:none;border-radius:4px">
Update Password Now</a></p>
<p>If you do not update within 24 hours, your account will be
temporarily locked and you will need to contact the IT Help Desk.</p>
<p>Thank you,<br>IT Help Desk</p>After submitting the simulation, monitor its progress from the Simulations tab. The simulation transitions through these states:
If emails are not being delivered, check these common issues:
# Verify simulation email delivery using message trace
Connect-ExchangeOnline
# Search for simulation emails sent in the last 24 hours
$simSender = "phishsim@simulation.contoso.com"
Get-MessageTrace -SenderAddress $simSender -StartDate (Get-Date).AddDays(-1) -EndDate (Get-Date) |
Select-Object Received, SenderAddress, RecipientAddress, Subject, Status |
Format-Table -AutoSize
# Check if emails were quarantined (indicates Advanced Delivery issue)
Get-QuarantineMessage -SenderAddress $simSender -StartDate (Get-Date).AddDays(-1) |
Select-Object ReceivedTime, SenderAddress, RecipientAddress, Subject, QuarantineTypes |
Format-Table -AutoSizeClick on the completed simulation to view its detailed results. The report provides these key metrics:
Click on the Users tab to see individual user results. Sort by “Compromised” to identify users who need training. Export the data to CSV for record-keeping and compliance documentation.
Key performance benchmarks:
Training modules are automatically assigned to users who failed the simulation (if configured in Step 4). You can also manually assign training from the Content library → Training modules tab.
Monitor training progress from the Training tab. Track completion rates by department to identify groups that may need additional support or in-person training sessions.
# Export simulation results using Microsoft Graph API
# Requires Microsoft.Graph PowerShell module
Connect-MgGraph -Scopes "AttackSimulation.Read.All"
# Get all simulations
$simulations = Get-MgSecurityAttackSimulation
$simulations | Select-Object DisplayName, Status, LaunchDateTime,
@{N='CompromisedCount';E={$_.Report.SimulationUsersCount.CompromisedCount}},
@{N='ClickedCount';E={$_.Report.SimulationUsersCount.ClickedLinkCount}},
@{N='ReportedCount';E={$_.Report.SimulationUsersCount.ReportedPhishCount}} |
Format-Table -AutoSize
# Get detailed user results for a specific simulation
$simId = $simulations[0].Id
$users = Get-MgSecurityAttackSimulationSimulationUser -AttackSimulationId $simId
$users | Select-Object SimulationUser, IsCompromised, AssignedTrainingsCount,
CompletedTrainingsCount | Export-Csv "SimulationResults.csv" -NoTypeInformation
Write-Host "Results exported to SimulationResults.csv" -ForegroundColor GreenSimulation Automations let you schedule recurring phishing campaigns that run automatically. Navigate to Simulation automations and click Create automation:
Users who fail multiple simulations represent the highest risk. Create a targeted escalation programme:
Use the Users analytics tab to filter for users who have been compromised in two or more simulations. Create a dynamic security group for repeat offenders to target them with additional simulations and training.
# Identify repeat offenders across all simulations
Connect-MgGraph -Scopes "AttackSimulation.Read.All"
$allSimulations = Get-MgSecurityAttackSimulation -Filter "status eq 'completed'"
$compromisedUsers = @{}
foreach ($sim in $allSimulations) {
$users = Get-MgSecurityAttackSimulationSimulationUser -AttackSimulationId $sim.Id
foreach ($user in $users | Where-Object { $_.IsCompromised -eq $true }) {
$email = $user.SimulationUser.Email
if ($compromisedUsers.ContainsKey($email)) {
$compromisedUsers[$email]++
} else {
$compromisedUsers[$email] = 1
}
}
}
# Display repeat offenders (compromised 2+ times)
$repeatOffenders = $compromisedUsers.GetEnumerator() |
Where-Object { $_.Value -ge 2 } |
Sort-Object Value -Descending |
Select-Object @{N='UserEmail';E={$_.Key}}, @{N='TimesCompromised';E={$_.Value}}
Write-Host "`nRepeat Offenders (Compromised 2+ times):" -ForegroundColor Yellow
$repeatOffenders | Format-Table -AutoSize
Write-Host "Total repeat offenders: $($repeatOffenders.Count)" -ForegroundColor CyanNavigate to the Overview tab of Attack Simulation Training to view trend data. The dashboard shows how your organisation’s key metrics have changed over time:
Compare your metrics against Microsoft’s industry benchmarks. The “Recommended actions” panel provides specific suggestions based on your data, such as increasing simulation frequency or targeting high-risk departments.
Export monthly reports capturing:
Transform your simulation data into a formal Security Awareness Programme with executive-level KPIs and documented procedures:
# Generate an executive summary report
Connect-MgGraph -Scopes "AttackSimulation.Read.All"
$simulations = Get-MgSecurityAttackSimulation -Filter "status eq 'completed'" |
Sort-Object LaunchDateTime -Descending
Write-Host "===== SECURITY AWARENESS EXECUTIVE REPORT =====" -ForegroundColor Cyan
Write-Host "Report Date: $(Get-Date -Format 'yyyy-MM-dd')"
Write-Host "Total Simulations Run: $($simulations.Count)"
Write-Host ""
$totalTargeted = 0; $totalCompromised = 0; $totalReported = 0
foreach ($sim in $simulations) {
$targeted = $sim.Report.SimulationUsersCount.TotalCount
$compromised = $sim.Report.SimulationUsersCount.CompromisedCount
$reported = $sim.Report.SimulationUsersCount.ReportedPhishCount
$totalTargeted += $targeted
$totalCompromised += $compromised
$totalReported += $reported
}
$avgClickRate = if ($totalTargeted -gt 0) { [math]::Round(($totalCompromised / $totalTargeted) * 100, 1) } else { 0 }
$avgReportRate = if ($totalTargeted -gt 0) { [math]::Round(($totalReported / $totalTargeted) * 100, 1) } else { 0 }
Write-Host "KEY PERFORMANCE INDICATORS:" -ForegroundColor Yellow
Write-Host " Average Compromise Rate : $avgClickRate%" -ForegroundColor $(if ($avgClickRate -lt 10) { 'Green' } elseif ($avgClickRate -lt 20) { 'Yellow' } else { 'Red' })
Write-Host " Average Report Rate : $avgReportRate%" -ForegroundColor $(if ($avgReportRate -gt 70) { 'Green' } elseif ($avgReportRate -gt 40) { 'Yellow' } else { 'Red' })
Write-Host " Total Users Tested : $totalTargeted"
Write-Host " Total Compromised : $totalCompromised"
Write-Host ""
# Recent simulation trend (last 6)
Write-Host "RECENT SIMULATION TREND:" -ForegroundColor Yellow
$simulations | Select-Object -First 6 | ForEach-Object {
$rate = if ($_.Report.SimulationUsersCount.TotalCount -gt 0) {
[math]::Round(($_.Report.SimulationUsersCount.CompromisedCount / $_.Report.SimulationUsersCount.TotalCount) * 100, 1)
} else { 0 }
Write-Host " $($_.LaunchDateTime.ToString('yyyy-MM-dd')) | $($_.DisplayName.Substring(0,[Math]::Min(40,$_.DisplayName.Length))) | Click Rate: $rate%"
}| Resource | Description |
|---|---|
| Get started with Attack simulation training | Overview and prerequisites for Attack Simulation Training |
| Simulate a phishing attack | Step-by-step guide to creating simulations |
| Simulation automations | Configure recurring automated simulation campaigns |
| Payloads in Attack simulation training | Create and manage custom phishing payloads |
| Insights and reports | Analyse simulation results and training completion |
| Training modules and campaigns | Manage training content and assignments |
| Configure Advanced Delivery for simulations | Ensure simulation emails bypass security filters |
| Landing pages in Attack simulation training | Create custom landing pages for simulations |