Describe the bug
When the recorded user (dpuerner or any target user) launches an application as administrator during a session, the recording file ends prematurely at that point.
Root Cause
This is caused by the UAC Secure Desktop (Winsta0\Winlogon). When Windows shows the elevation prompt ("Do you want to allow this app to make changes..."), it temporarily switches from the user's normal desktop (Winsta0\Default) to a separate, isolated secure desktop.
gdigrab -i desktop holds an OS handle to Winsta0\Default. When the switch occurs, that handle becomes invalid and FFmpeg exits with code 0 (a clean exit, not a crash code) — stopping the recording at exactly the moment UAC fires.
Note: The exit code being 0 is important. A fix based on checking for non-zero exit codes would not catch UAC-triggered exits and would incorrectly treat them as graceful logoffs.
Impact
Any elevated action (right-click → Run as administrator, installers, UAC prompts) will silently end the recording. For Dina's iKAT error capture use case, if the error occurs after an elevation prompt, the recording will be missing the relevant footage.
Steps to Reproduce
- Log on as the target user
- Confirm recording is active (
C:\Recordings has a growing .ts file)
- Right-click any application → Run as administrator
- Observe the UAC prompt
- Check
C:\Recordings — the .ts file has stopped growing; a new file is NOT started
Proposed Fix
Add a restart loop to Invoke-iKATRecording.ps1. Instead of the script exiting when FFmpeg exits, it should check if the current user session is still active and, if so, start a new FFmpeg instance with a new timestamped output file.
# Pseudocode
while ($userSessionActive) {
$outputFile = "$TargetUser_session_$(Get-Date -Format 'yyyyMMdd_HHmmss').ts"
Start-FFmpeg -OutputFile $outputFile
Wait-ForFFmpegToExit
# If we're still logged in, loop and start a new recording segment
}
This means a single session could produce multiple .ts files (e.g., one before the UAC prompt, one after), but no footage is permanently lost.
Acceptance Criteria
Describe the bug
When the recorded user (
dpuerneror any target user) launches an application as administrator during a session, the recording file ends prematurely at that point.Root Cause
This is caused by the UAC Secure Desktop (
Winsta0\Winlogon). When Windows shows the elevation prompt ("Do you want to allow this app to make changes..."), it temporarily switches from the user's normal desktop (Winsta0\Default) to a separate, isolated secure desktop.gdigrab -i desktopholds an OS handle toWinsta0\Default. When the switch occurs, that handle becomes invalid and FFmpeg exits with code0(a clean exit, not a crash code) — stopping the recording at exactly the moment UAC fires.Note: The exit code being
0is important. A fix based on checking for non-zero exit codes would not catch UAC-triggered exits and would incorrectly treat them as graceful logoffs.Impact
Any elevated action (right-click → Run as administrator, installers, UAC prompts) will silently end the recording. For Dina's iKAT error capture use case, if the error occurs after an elevation prompt, the recording will be missing the relevant footage.
Steps to Reproduce
C:\Recordingshas a growing.tsfile)C:\Recordings— the.tsfile has stopped growing; a new file is NOT startedProposed Fix
Add a restart loop to
Invoke-iKATRecording.ps1. Instead of the script exiting when FFmpeg exits, it should check if the current user session is still active and, if so, start a new FFmpeg instance with a new timestamped output file.This means a single session could produce multiple
.tsfiles (e.g., one before the UAC prompt, one after), but no footage is permanently lost.Acceptance Criteria
.tsfile is automatically started after FFmpeg exits mid-session