Powershell connecting from a linux client to a windows remote

Alfredo Palhares picture Alfredo Palhares · May 2, 2017 · Viewed 11.3k times · Source

I am trying to remotely connect to a windows machine from my Linux workstation.

I installed powershell on my Arch Linux workstation and I am currently trying to connect to the host.

On the host:

Enable-PSRemoting

Then allowed all hosts with Set-Item wsman:\localhost\client\trustedhosts *

Checking everything with:

PS C:\windows\system32> ls WSMan:\localhost\shell


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess                         true
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             2147483647
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           2147483647
System.String   MaxMemoryPerShellMB                            2147483647
System.String   MaxShellsPerUser                               2147483647

Now when I try to connect from Linux workstation:

PS /home/user/tmp> Enter-PSSession -ComputerName "myuser" -Credential DOMAIN\myuser

Windows PowerShell credential request
Enter your credentials.
Password for user DOMAIN\myuser: *****************

Enter-PSSession : MI_RESULT_ACCESS_DENIED
At line:1 char:1
+ Enter-PSSession -ComputerName "myuser" -Credential DOMAIN\ajpalhare ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (myuser:String) [Enter-PSSession
   ], PSInvalidOperationException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

I don't anything on the the winrm windows event logs.

Any suggestions welcome,

Answer

Phil picture Phil · May 2, 2017

WinRM from Linux/OSX is not currently supported but support is on the way.

https://github.com/PowerShell/PowerShell/issues/942