Windows: drives mapped on the desktop don't exist over SSH, even with sshd running in your own desktop session (UAC split token, EnableLinkedConnections)
Saving this to save someone else the trouble, since I couldn't find it written down anywhere in one place. Correct me if I'm wrong!
The setup: Win32-OpenSSH on Windows 11 Pro, a workgroup machine (no domain), local admin account. The normal sshd service runs as SYSTEM, so key-based sessions are network logons with no credentials: no SMB, no Credential Manager, no mapped drives. To get around that I run a second sshd as the user, from a scheduled task at logon, in the user's desktop session, with "Run with highest privileges" so SSH sessions are elevated:
$Action = New-ScheduledTaskAction -Execute 'C:\Windows\System32\conhost.exe' `
-Argument '--headless "C:\Windows\System32\OpenSSH\sshd.exe" -D -f "C:\Users\me\sshd-user\sshd_config"'
$Trigger = New-ScheduledTaskTrigger -AtLogOn -User 'me'
$Principal = New-S