Isolated Mode? Logon NetCredentials Only Not Respected In Shell Process #23718

Open
opened 2026-01-31 08:50:21 +00:00 by claunia · 2 comments
Owner

Originally created by @mattcargile on GitHub (Oct 16, 2025).

Windows Terminal version

1.23.12811.0

Windows build number

10.0.22631.0

Other Software

No other software.

Notes

The related api is this link, namely, the dwLogonFlags parameter and LOGON_NETCREDENTIALS_ONLY. Switching to wezterm for now because I need this workflow and I can't go back to conhost.exe.

Other Attempts

I use scoop too. I used to be able to make it work by calling WindowsTerminal.exe directly thereby avoiding the shim and soft link. Now even calling WindowsTerminal.exe directly stopped working.

Steps to reproduce

Can use ProcessEx or native binary runas.exe.

Install-Module ProcessEx
start-processwith -FilePath wt -Credential (get-credential domain\user) -NetCredentialsOnly
# or
runas /netonly /user:domain\user wt

Expected Behavior

When using Invoke-Command -ComputerName remote -ScriptBlock { whoami } or the like should return the net credential user name.

Actual Behavior

When using Invoke-Command -ComputerName remote -ScriptBlock { whoami } or the like the local non network only credential user is returned.

Workaround

So it appears this is related to wt and WindowsTerminal avoiding creating a brand new process when one already exists. So I was inheriting from the previous process so my net only cred was being ignored.

Solution is to open conhost first and then launch wt making sure that there isn't already a window opened.

It would be nice if there was a way to launch a brand new process though. It appears one is only able to have one wt process open at once.

Originally created by @mattcargile on GitHub (Oct 16, 2025). ### Windows Terminal version 1.23.12811.0 ### Windows build number 10.0.22631.0 ### Other Software No other software. #### Notes The related api is this [link](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithtokenw#parameters), namely, the `dwLogonFlags` parameter and `LOGON_NETCREDENTIALS_ONLY`. Switching to `wezterm` for now because I need this workflow and I can't go back to `conhost.exe`. #### Other Attempts I use `scoop` too. I used to be able to make it work by calling `WindowsTerminal.exe` directly thereby avoiding the _shim_ and _soft link_. Now even calling `WindowsTerminal.exe` directly stopped working. ### Steps to reproduce Can use [`ProcessEx`](https://github.com/jborean93/processex) or native binary `runas.exe`. ```pwsh Install-Module ProcessEx start-processwith -FilePath wt -Credential (get-credential domain\user) -NetCredentialsOnly # or runas /netonly /user:domain\user wt ``` ### Expected Behavior When using `Invoke-Command -ComputerName remote -ScriptBlock { whoami }` or the like should return the net credential user name. ### Actual Behavior When using `Invoke-Command -ComputerName remote -ScriptBlock { whoami }` or the like the local non network only credential user is returned. #### Workaround So it appears this is related to `wt` and `WindowsTerminal` avoiding creating a brand new process when one already exists. So I was inheriting from the previous process so my net only cred was being ignored. Solution is to open `conhost` first and then launch `wt` making sure that there isn't already a window opened. It would be nice if there was a way to launch a brand new process though. It appears one is only able to have one `wt` process open at once.
claunia added the Issue-BugPriority-3Product-TerminalArea-Remoting labels 2026-01-31 08:50:21 +00:00
Author
Owner

@jborean93 commented on GitHub (Oct 16, 2025):

I've had a look into this and it seems like wt.exe and the direct WindowsTerminal.exe works like VSCode in that if no existing WT processes are running it'll continue running as the WT process. If a new WT process is started it'll communicate back with the first WT process to open a new window and the new process exits. This means that WT only ever has 1 process running outside of an limited vs elevated through UAC context.

The only way around this is to ensure that the first WT instance was launch with the /netonly argument which could be done by using conhost directly. This would mean that any new console process' started normally would also inherit this output network credential. Another alternative is to see if there is any flag on wt.exe to force it to use a new process but I'm unsure if this is possible.

@jborean93 commented on GitHub (Oct 16, 2025): I've had a look into this and it seems like `wt.exe` and the direct `WindowsTerminal.exe` works like VSCode in that if no existing WT processes are running it'll continue running as the WT process. If a new WT process is started it'll communicate back with the first WT process to open a new window and the new process exits. This means that WT only ever has 1 process running outside of an limited vs elevated through UAC context. The only way around this is to ensure that the first WT instance was launch with the `/netonly` argument which could be done by using conhost directly. This would mean that any new console process' started normally would also inherit this output network credential. Another alternative is to see if there is any flag on `wt.exe` to force it to use a new process but I'm unsure if this is possible.
Author
Owner

@DHowett commented on GitHub (Oct 22, 2025):

Oh yeah, this is a case we've never really looked into. We recently fixed some issues around account handling and handing Terminal commandlines over to running instances, but I legitimately have no idea how we should differentiate "net-only" tokens...

We also recently got rid of isolated mode. Perhaps we should bring it back... so that you can run wt --isolated with net credentials :)

@DHowett commented on GitHub (Oct 22, 2025): Oh yeah, this is a case we've never really looked into. We recently fixed some issues around account handling and handing Terminal commandlines over to running instances, but I legitimately have no idea how we should differentiate "net-only" tokens... We also recently got rid of isolated mode. Perhaps we should bring it back... so that you can run `wt --isolated` with net credentials :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23718