1

I have a windows server 2016 (version 1607, build 14393) with OpenSSH installed and running.

Recently, I noticed that I am no longer able to run powershell from a remote client when connecting via SSH, and keep getting the 'Powershell' is not recognized as an internal or external command, operable program or batch file error. I also tried running it locally via CMD, and got the same error above.

I followed this question and discovered I was suddenly missing an environment variable path to powershell. By adding %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ to my Path I was able to run powershell locally again via CMD.

Yet even with this fix I am still unable to run powershell when connected using SSH, which is even more strange, as SSH connections are always ran as CMD in windows by default.

Here is an example of my connection process (running from ubuntu 16.04 terminal):

foo@foo:~$ ssh administrator@_SERVER_IP_
administrator@_SERVER_IP_\`s password:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

administrator@_SERVER_IP_ C:\Users\Administrator>powershell
'Powershell' is not recognized as an internal or external command,  operable program or batch file.

administrator@_SERVER_IP_ C:\Users\Administrator> where powershell.exe
INFO: Could not find files for the given pattern(s).

Any hint what might be the cause for this problem?

Pizza
  • 311
  • 2
  • 8

0 Answers0