Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
508e55d
Add legacy driver and GlobalFlag IPU blocker detection to OSUpgrade A…
jdickson289 May 9, 2026
c786628
Add simple offline TSS rescue wrapper and README
jdickson289 Jun 9, 2026
0113999
Potential fix for pull request finding
jdickson289 Jun 12, 2026
da3cc80
Potential fix for pull request finding
jdickson289 Jun 12, 2026
e011d21
Potential fix for pull request finding
jdickson289 Jun 12, 2026
2a816f8
Handle root-level Windows path when deriving offline disk root
jdickson289 Jun 12, 2026
b91f343
Continue collection when files are locked during copy
jdickson289 Jun 12, 2026
daa06a6
Default TSS to -SDP Setup and fix AmbiguousParameterSet via hashtable…
jdickson289 Jun 16, 2026
315106c
Reformat README to repo house style; rename to TSS Offline Log Collector
jdickson289 Jun 17, 2026
34c4593
Remove Windows_OSUpgrade_Assessment_Validation.ps1 changes (moved to …
jdickson289 Jun 17, 2026
f9ef19a
[P1 FIX] Security: Gate credential-bearing registry hives behind expl…
jdickson289 Jun 17, 2026
d9e65cd
[MAJOR] Refactor to Option A: pure offline static collection
jdickson289 Jun 17, 2026
2c30c6e
Registry hives now always collected by default
jdickson289 Jun 17, 2026
3262ac9
Expand collection to comprehensive TSS.ps1 DND_SetupReport/SDP Setup …
jdickson289 Jun 17, 2026
de0cdd3
Add legacy WindowsUpdate.log collection and clarify ETL vs readable log
jdickson289 Jun 17, 2026
39c829c
Rename script to tssofflinelogcollector.ps1 to reflect its purpose
jdickson289 Jun 17, 2026
0350633
Fix directory creation logic for custom OutputPath
jdickson289 Jun 17, 2026
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
115 changes: 115 additions & 0 deletions RunCommand/Windows/TSSOfflineRescueWrapper/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# TSS Offline Log Collector

PowerShell script for rescue-VM scenarios that collects Windows troubleshooting logs from an offline (broken) VM OS disk attached to a working rescue VM.

## Design

**Pure offline static file collection** — this script collects diagnostic files from the attached broken disk only. It does NOT run TSS.ps1 or execute any live diagnostics. This is intentional: TSS.ps1 requires a running OS and cannot operate on offline disks.

## What It Collects

**Comprehensive offline diagnostic collection** (aligned with TSS.ps1 DND_SetupReport / SDP Setup):

- **Event logs** — All event logs from `winevt\Logs`
- **Windows Update & Servicing** — CBS, DISM, WindowsUpdate ETL trace files (Windows 10+) and WindowsUpdate.log (legacy OS), SoftwareDistribution, WinSxS pending/servicing, USO logs
- *Note: On Windows 10+, use `Get-WindowsUpdateLog` on a running system to generate human-readable log from collected ETL files*
- **Setup & Upgrade** — Panther logs (Windows, $Windows.~BT, Sysprep), Modern Setup (MoSetup)
- **Drivers** — Complete INF folder (setupapi logs), DriverStore repository, DPX device setup logs
- **Certificates** — catroot2 certificate catalog
- **Error Reporting** — Windows Error Reporting (WER) logs and reports
- **Crash Analysis** — Minidumps, LiveKernelReports, optionally MEMORY.DMP with `-IncludeMemoryDump`
- **System Diagnostics** — System32\LogFiles, WinSAT performance, Windows Temp
- **Activation & Licensing** — Software Protection Platform (SPP) store
- **Security** — Windows Defender logs (if present), Firewall logs
- **Task Scheduler** — Scheduled tasks configuration and logs
- **Registry hives** (always collected):
- Safe diagnostic hives: SYSTEM, SOFTWARE, COMPONENTS
- Credential-bearing hives with explicit consent (`-IncludeCredentialHives`): SAM, SECURITY, DEFAULT

## Output

- **Chain-of-custody manifest** (`manifest.json`) — lists all collected/skipped files with size and SHA-256 hash
- **Self-transcript** (`wrapper-transcript.log`) — complete log of the wrapper's execution
- Optional zip bundle (`-ZipOutput`)

## Prerequisites

- PowerShell 5.1 or higher
- **Run from an elevated (Run as administrator) PowerShell console**
- The broken VM OS disk must already be attached to the rescue VM

## Usage

From an elevated PowerShell console:

```powershell
Set-ExecutionPolicy Bypass -Force
```

### Basic collection (disk 2 has the offline OS)
```powershell
.\tssofflinelogcollector.ps1 -Disk 2 -ZipOutput
```

### With MEMORY.DMP (if crash analysis is required)
```powershell
.\tssofflinelogcollector.ps1 -Disk 2 -IncludeMemoryDump -ZipOutput
```

### ⚠️ With credential-bearing registry hives (use with caution)
```powershell
# Only use when explicitly required for troubleshooting
.\tssofflinelogcollector.ps1 -Disk 2 -IncludeCredentialHives -ZipOutput
```

### Custom output path
```powershell
.\tssofflinelogcollector.ps1 -Disk 2 -OutputPath "D:\DiagnosticCollections" -ZipOutput
```

### Dry-run preview (no actual copy)
```powershell
.\tssofflinelogcollector.ps1 -Disk 2 -WhatIf
```

## Parameters

- `-OfflineWindowsRoot <path>`: Offline Windows directory (example `F:\Windows`).
- `-Disk <number|drive>`: Disk selector, supports disk number (`2`) or drive (`E`, `E:`, `E:\`).
- `-OutputPath <path>`: Override default output root (`C:\MS_DATA\TSS_PERF_OFFLINE`).
- `-IncludeCredentialHives`: **⚠️ SECURITY SENSITIVE** — Include credential-bearing hives (SAM, SECURITY, DEFAULT) in addition to the always-collected safe hives (SYSTEM, SOFTWARE, COMPONENTS). These hives contain password hashes, LSA secrets, and DPAPI material. Only use when explicitly required for troubleshooting.
- `-IncludeMemoryDump`: **⚠️ LARGE + SENSITIVE** — Include MEMORY.DMP (may be several GB and contain in-memory secrets). Only use when explicitly required for crash analysis.
- `-ZipOutput`: Create zip after collection.
- `-Force`: Allow overwrite when output folder already exists.
- `-WhatIf`: Preview what would be collected without actually copying files.

## Output

- **Default root**: `C:\MS_DATA\TSS_PERF_OFFLINE` (override with `-OutputPath`)
- **Run folder**: `offline-tss-wrapper-<timestamp>`
- **Manifest**: `manifest.json` (lists all collected/skipped files with size and SHA-256)
- **Transcript**: `wrapper-transcript.log` (complete execution log)
- **Optional zip**: `offline-tss-wrapper-<timestamp>.zip` (with `-ZipOutput`)

## Notes

- This wrapper collects **static files only** from the offline disk. It does not run TSS.ps1 or any live diagnostics.
- **Comprehensive collection** — collects all diagnostic files TSS.ps1 DND_SetupReport/SDP Setup would gather (event logs, servicing logs, driver store, WER, etc.)
- **Collection size** — expect several hundred MB to several GB depending on system state (more if DriverStore/WER contain many files). Use `-WhatIf` to preview before collecting.
- **Registry hives are always collected** (SYSTEM, SOFTWARE, COMPONENTS) — these are essential for proper troubleshooting.
- MEMORY.DMP is opt-in (`-IncludeMemoryDump`) because it can be several GB and may contain in-memory secrets.
- Credential-bearing registry hives (SAM/SECURITY/DEFAULT) require explicit consent (`-IncludeCredentialHives`) to prevent accidental exposure of password hashes and LSA secrets.
- Use `-WhatIf` to preview what would be collected without actually copying files.
- The manifest (`manifest.json`) provides chain-of-custody documentation for all collected artifacts with SHA-256 hashes.

## Known Issues

None currently.

## Liability

As described in the [MIT license](..\..\..\LICENSE.txt), these scripts are provided as-is with no warranty or liability associated with their use.

## Provide Feedback

We value your input. If you encounter problems with the scripts or have ideas on how they can be improved, please file an issue in the [Issues](https://github.com/Azure/azure-support-scripts/issues) section of the project.
Loading