PowerShell / PowerShell/Win32-OpenSSH

netsh wlan connect name=profile_name not working over SSH when Remote Desktop is enabled

Open
#2,033 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Investigate
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

The issue occurs when you try to execute netsh wlan connect name=profile_name.

To reproduce the issue you need all three conditions:

  • Calling netsh wlan connect over SSH
  • Having remote desktop service enabled
  • The profile you are connecting to is 802.1x (e.g. WPA2 Enterprise)

Only having two of the conditions it will work, e.g. disabling remote desktop, using WPA2 Personal, or calling netsh command direct from the terminal window.

Expected behavior

The netsh wlan connect command runs and the connection is established successfully.

Actual behavior

The command returns success but it does not connect.

Error details

If you look into the WLAN-AutoConfig logs in Event Viewer you see the error:
Reason: Unable to identify a user for 802.1X authentication.

Checking the OneX logs in Event Viewer you see the error:
Port(2): Error 0x3F0 in calling WTSQueryUserToken. Proposing machine authentication.

Environment data
Name                           Value                                           
----                           -----                                           
PSVersion                      5.1.22621.963                                   
PSEdition                      Desktop                                         
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
BuildVersion                   10.0.22621.963                                  
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Version

OpenSSH_for_Windows_8.6p1

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing netsh wlan connect name=profile_name over SSH with Remote Desktop enabled and an 802.1X profile. Compare the WLAN-AutoConfig and OneX Event Viewer logs, including the WTSQueryUserToken error. Done means the command establishes the authenticated wireless connection instead of returning success without connecting.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.