Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
*.png binary
*.webp binary
*.jpg binary
tools/microsoft-365-incident-triage-toolkit/** text eol=lf
scripts/package-triage-toolkit.ps1 text eol=lf
assets/downloads/*.zip binary
7 changes: 7 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
- name: Test offline Entra sign-in triage
shell: pwsh
run: ./scripts/test-entra-sign-in-triage.ps1
- name: Test offline Microsoft 365 incident triage toolkit
shell: pwsh
run: |
# Isolate expected failure cases from the workflow host's exit code.
pwsh -NoProfile -File ./tools/microsoft-365-incident-triage-toolkit/tests/Test-M365IncidentTriage.ps1
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
./scripts/package-triage-toolkit.ps1 -Check
- name: Check build guards and resolved routing
run: bundle exec ruby scripts/test-build.rb
- name: Build once
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ The normal content validator checks strict sitemap XML, unique canonical URLs, e

After publication, check that the public sitemap and robots file return HTTP 200. In the verified `dleontev.com` property in Google Search Console and Bing Webmaster Tools, submit the sitemap and inspect Home, About, the Projects index, a project, and a recent article. Review indexing/canonical results and Bing AI Performance where available. Local preview URLs cannot be submitted; account verification and live deployment must come first.

## Microsoft 365 incident triage toolkit

The Microsoft 365 incident triage toolkit source, offline tests, and synthetic samples live in `tools/microsoft-365-incident-triage-toolkit/`, which is excluded from Jekyll output. The downloadable ZIP is built from an explicit file list. After changing toolkit files, use PowerShell 7.5 or later:

```powershell
./tools/microsoft-365-incident-triage-toolkit/tests/Test-M365IncidentTriage.ps1
./scripts/package-triage-toolkit.ps1
./scripts/package-triage-toolkit.ps1 -Check
```

The offline tests do not connect to a tenant. Published samples must stay synthetic; live output belongs outside the repository.

## Article navigation and search

`jekyll-feed` generates `/feed.xml` as an Atom feed of the ten most recent published articles, including full content, summaries, canonical article links, and the shared author name. `{% feed_meta %}` adds feed discovery in the shared head, and the footer exposes a Subscribe link. The feed remains outside the HTML sitemap. Content validation checks strict Atom XML, article coverage and order, author identity, and discovery/Subscribe links.
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exclude:
- playwright.config.cjs
- tests
- scripts
- tools
- docs
- test-results
- playwright-report
Expand Down

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions _projects/04-microsoft-365-support-operations-toolkit.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
---
title: Microsoft 365 Support Operations Toolkit
order: 4
status: Planned
status: In progress
tools: [Microsoft 365, PowerShell, Support Engineering]
description: A planned collection of reusable templates and safe automation patterns for technical triage, stakeholder updates, escalation evidence, and service documentation.
description: A read-only Microsoft 365 incident triage collector with a walkthrough, synthetic examples, offline tests, and an escalation template.
article: /blog/building-a-microsoft-365-incident-triage-toolkit-with-powershell
permalink: /projects/microsoft-365-support-operations-toolkit/
---

# Microsoft 365 Support Operations Toolkit

**Status:** Planned
**Status:** In progress — first toolkit available

This project will collect reusable, sanitized support-engineering resources for Microsoft 365 operations.
This project collects reusable support-engineering resources for Microsoft 365 operations. The first release captures incident context and Microsoft Graph service-health data, then generates a consistent escalation report.

## Planned scope
## Available now

- Initial triage and evidence collection templates
- Stakeholder update and escalation templates
- Service-health and known-issue checks
- [Building a Microsoft 365 Incident Triage Toolkit with PowerShell]({% post_url 2026-09-15-building-a-microsoft-365-incident-triage-toolkit-with-powershell %})
- [Download the toolkit, synthetic examples, tests, and escalation template]({{ '/assets/downloads/microsoft-365-incident-triage-toolkit.zip' | relative_url }})
- [Browse the PowerShell source](https://github.com/dleontev/dleontev.github.io/tree/main/tools/microsoft-365-incident-triage-toolkit)

Version 1.0 uses read-only Graph requests and delegated authentication in the Global environment. Offline tests use synthetic data and a mocked Graph connection; live tenant integration has not been tested.

## Further work

- Workload-specific evidence collectors and runbooks
- Stakeholder update templates
- Troubleshooting runbook structure
- Safe PowerShell and Microsoft Graph examples
- Verification, rollback, and closure checklists

Scripts will use safe defaults, limited permissions, mock data, and preview or dry-run behavior when practical. No credentials, tokens, tenant details, or employer-specific data will be published.
Published examples contain synthetic data. Real output should remain in an approved incident location and be reviewed before sharing. Future collectors will keep permissions and failure behavior explicit, with remediation handled through separate reviewed procedures.
Binary file not shown.
49 changes: 49 additions & 0 deletions scripts/package-triage-toolkit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#requires -Version 7.5
[CmdletBinding()]
param([switch]$Check)
$ErrorActionPreference = 'Stop'
$repo = Split-Path $PSScriptRoot -Parent
$source = Join-Path $repo 'tools/microsoft-365-incident-triage-toolkit'
$destination = Join-Path $repo 'assets/downloads/microsoft-365-incident-triage-toolkit.zip'
$files = @('Export-M365IncidentTriage.ps1', 'M365IncidentTriage.psm1', 'README.md',
'demo-snapshot.json', 'escalation-template.md', 'samples/evidence.json',
'samples/report.md', 'tests/Test-M365IncidentTriage.ps1') | Sort-Object
$sample = Get-Content -LiteralPath (Join-Path $source 'samples/evidence.json') -Raw | ConvertFrom-Json -AsHashtable -DateKind String
if ($sample.Mode -ne 'Demo' -or $sample.TenantId -ne 'SYNTHETIC — no tenant') {
throw 'Only the synthetic demo sample may be packaged.'
}
Add-Type -AssemblyName System.IO.Compression
if ($Check) {
$zip = [IO.Compression.ZipFile]::OpenRead($destination)
try {
if ($zip.Entries.Count -ne $files.Count) { throw 'Unexpected archive entries.' }
foreach ($file in $files) {
$entry = $zip.GetEntry($file)
if (-not $entry) { throw "Missing archive file: $file" }
$stream = $entry.Open()
$buffer = [IO.MemoryStream]::new()
try {
$stream.CopyTo($buffer)
$expected = [Convert]::ToBase64String([IO.File]::ReadAllBytes((Join-Path $source $file)))
if ([Convert]::ToBase64String($buffer.ToArray()) -cne $expected) { throw "Stale archive file: $file" }
} finally { $stream.Dispose(); $buffer.Dispose() }
}
} finally { $zip.Dispose() }
Write-Host 'Toolkit ZIP matches all eight source files; sample is synthetic.'
} else {
$null = [IO.Directory]::CreateDirectory((Split-Path $destination -Parent))
$stream = [IO.File]::Open($destination, [IO.FileMode]::Create)
$zip = [IO.Compression.ZipArchive]::new($stream, [IO.Compression.ZipArchiveMode]::Create)
try {
foreach ($file in $files) {
$entry = $zip.CreateEntry($file)
$entry.LastWriteTime = [datetimeoffset]'2000-01-01T00:00:00Z'
$entryStream = $entry.Open()
try {
$bytes = [IO.File]::ReadAllBytes((Join-Path $source $file))
$entryStream.Write($bytes, 0, $bytes.Length)
} finally { $entryStream.Dispose() }
}
} finally { $zip.Dispose(); $stream.Dispose() }
Write-Host "Packaged $destination"
}
7 changes: 6 additions & 1 deletion tests/site.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,22 @@ test('content, Home and contents remain available without JavaScript',async({bro
await page.locator('.article-toc summary').click(); await expect(page.locator('.article-toc nav')).toBeVisible(); await context.close();
});

test('message trace and release commands scroll by keyboard without JavaScript',async({browser})=>{
test('PowerShell examples scroll by keyboard without JavaScript',async({browser})=>{
const context=await browser.newContext({javaScriptEnabled:false,viewport:{width:390,height:844}});
try {
const page=await context.newPage();
for (const [route,count] of [
['/blog/where-did-the-email-go-troubleshooting-exchange-online-with-message-trace',4],
['/blog/building-a-microsoft-365-incident-triage-toolkit-with-powershell',6],
['/projects/pomodoro-timer/',1],
]) {
await page.goto('http://127.0.0.1:4000'+route);
const examples=page.locator('.language-powershell pre');
await expect(examples).toHaveCount(count);
for (const example of await examples.all()) {
await expect(example).toHaveAttribute('tabindex','0');
await expect(example).toHaveAccessibleName('Code example');
}
const example=examples.first();
await expect(example).toHaveAccessibleName('Code example');
expect(await example.evaluate(el=>el.scrollWidth>el.clientWidth)).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#requires -Version 7.5
<#
.SYNOPSIS
Collect a read-only Microsoft 365 service-health snapshot and incident handoff.
.DESCRIPTION
Demo mode uses packaged synthetic data without Graph. Live mode requires an existing
delegated Graph connection to the explicit tenant in the Global environment.
Each run creates a new directory under OutputRoot. Incomplete collection writes the
available evidence, then throws; pwsh -File returns a nonzero exit code.
#>
[CmdletBinding(DefaultParameterSetName = 'Live')]
param(
[Parameter(Mandatory, ParameterSetName = 'Demo')][switch]$Demo,
[Parameter(Mandatory, ParameterSetName = 'Live')][guid]$TenantId,
[Parameter(Mandatory)][ValidatePattern('^[A-Za-z0-9][A-Za-z0-9_-]{0,59}$')][string]$IncidentId,
[Parameter(Mandatory)][ValidateScript({ -not [string]::IsNullOrWhiteSpace($_) })][ValidateLength(1, 2000)][string]$Symptom,
[Parameter(Mandatory)][ValidateScript({ -not [string]::IsNullOrWhiteSpace($_) })][ValidateLength(1, 2000)][string]$Impact,
[Parameter(Mandatory)][string]$FirstObservedUtc,
[ValidateRange(0, 168)][int]$LookBackHours = 24,
[ValidateNotNullOrEmpty()][string]$OutputRoot = (Join-Path ([Environment]::GetFolderPath('UserProfile')) 'm365-triage')
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Import-Module (Join-Path $PSScriptRoot 'M365IncidentTriage.psm1') -Force
$first = [datetimeoffset]::ParseExact($FirstObservedUtc, "yyyy-MM-dd'T'HH:mm:ss'Z'",
[cultureinfo]::InvariantCulture, [Globalization.DateTimeStyles]::AssumeUniversal)
$started = [datetimeoffset]::UtcNow
$mode = 'Live'
$graphVersion = $null
if ($PSCmdlet.ParameterSetName -eq 'Demo') {
$mode = 'Demo'
$fixture = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'demo-snapshot.json') -Raw |
ConvertFrom-Json -AsHashtable -DateKind String
$started = [datetimeoffset]::Parse($fixture.snapshotAtUtc, [cultureinfo]::InvariantCulture)
$tenantLabel = 'SYNTHETIC — no tenant'
$request = {
param($uri)
$resource = ([uri]$uri).Segments[-1]
if (-not $fixture.collections.Contains($resource)) { throw 'Unknown demo collection.' }
$fixture.collections[$resource]
}.GetNewClosure()
} else {
Import-Module Microsoft.Graph.Authentication -ErrorAction Stop
Assert-TriageContext -Context (Get-MgContext) -TenantId $TenantId
$graphVersion = (Get-Module Microsoft.Graph.Authentication).Version.ToString()
$tenantLabel = $TenantId.ToString()
$request = {
param($uri)
Invoke-MgGraphRequest -Method GET -Uri $uri -OutputType Hashtable -ErrorAction Stop
}
}
if ($first -gt $started) { throw 'FirstObservedUtc must not be after the snapshot time (the demo uses 2026-09-14T16:30:00Z).' }
$since = $first.AddHours(-$LookBackHours)
$health = Read-TriageCollection -Resource healthOverviews -Request $request
$issues = Read-TriageCollection -Resource issues -Request $request
$status = if ($health.Status -eq 'Complete' -and $issues.Status -eq 'Complete') { 'Complete' } else { 'Incomplete' }
$finished = if ($mode -eq 'Demo') { $started } else { [datetimeoffset]::UtcNow }
$evidence = [ordered]@{
SchemaVersion = '1.0'
ToolkitVersion = '1.0.0'
Mode = $mode
TenantId = $tenantLabel
PowerShellVersion = $PSVersionTable.PSVersion.ToString()
GraphAuthenticationVersion = $graphVersion
StartedAtUtc = $started.ToUniversalTime().ToString('o')
FinishedAtUtc = $finished.ToUniversalTime().ToString('o')
Incident = [ordered]@{
IncidentId = $IncidentId; Symptom = $Symptom; Impact = $Impact
FirstObservedUtc = $first.ToUniversalTime().ToString('o')
}
IssuesSinceUtc = $since.ToUniversalTime().ToString('o')
CollectionStatus = $status
Collections = [ordered]@{ HealthOverviews = $health; Issues = $issues }
CandidateIssues = @(Select-TriageIssue -Issues $issues.Items -SinceUtc $since)
}
# Unique directories preserve previous evidence, even for repeated runs of the same incident.
$root = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutputRoot)
$null = [IO.Directory]::CreateDirectory($root)
$runName = $IncidentId + '-' + [datetimeoffset]::UtcNow.ToString('yyyyMMddTHHmmssfffZ') + '-' + [guid]::NewGuid().ToString('N')
$runDirectory = Join-Path $root $runName
$null = New-Item -ItemType Directory -Path $runDirectory -ErrorAction Stop
$json = ($evidence | ConvertTo-Json -Depth 20) -replace "`r`n", "`n"
$report = ConvertTo-TriageReport -Evidence $evidence
Set-Content -LiteralPath (Join-Path $runDirectory 'evidence.json') -Value ($json + "`n") -Encoding utf8NoBOM -NoNewline
Set-Content -LiteralPath (Join-Path $runDirectory 'report.md') -Value ($report + "`n") -Encoding utf8NoBOM -NoNewline
[pscustomobject]@{ CollectionStatus = $status; Mode = $mode; OutputDirectory = $runDirectory }
if ($status -ne 'Complete') {
throw "Collection is incomplete. Review collection results in $runDirectory before using this evidence."
}
Loading