Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter-PSSession Centos To Windows Fails #7425

Closed
danielman111 opened this issue Aug 1, 2018 · 5 comments
Closed

Enter-PSSession Centos To Windows Fails #7425

danielman111 opened this issue Aug 1, 2018 · 5 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.

Comments

@danielman111
Copy link

danielman111 commented Aug 1, 2018

Using PowerShell version 6.0.2 on Centos 7, trying to get Session to Windows 2012 Server.
Doing the following:

$secpasswd = ConvertTo-SecureString "password" -AsPlainText -Force

$mycreds = New-Object System.Management.Automation.PSCredential ("domain\username", $secpasswd)

Enter-PSSession -ComputerName Some-Host-Name -port 5985 -Credential $mycreds

Getting the Following Error:

 Enter-PSSession : MI_RESULT_ACCESS_DENIED                                                                                       At line:1 char:2
+  Enter-PSSession -ComputerName Some-Host-Name -port 5985 -Credential $m ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (Some-Host-Name :String) [Enter-PSSession], PSInvalidOperationException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Should get session to the Windows Machine.

Any ideas what I need to do?

@kvprasoon
Copy link
Contributor

kvprasoon commented Aug 2, 2018

@danielman111 PowerShell remoting from Linux to Windows currently works only using ssh . See Remoting over WSMan section here and see examples here.

@danielman111
Copy link
Author

danielman111 commented Aug 2, 2018

@danielman111 PowerShell remoting from Linux to Windows currently works only using ssh . See Remoting over WSMan section here and see examples here.

So the official answer is that PowerShell Core cant use Enter-PSSession to gain session from Linux to Windows?

@danielman111
Copy link
Author

danielman111 commented Aug 2, 2018

In the Link kvprasoon added, under Remoting over WSMan, it says the following:

for macOS/Linux -> Windows remoting scenarios, our goal is to enable existing remoting cmdlets (e.g. Enter-PSSession, New-PSSession, and Invoke-Command) using the traditional WSMan protocol. This currently works for basic authentication as well as for NTLM-based authentication from (only) Linux environments.

So if I understand it correctly, It should be able me to use Enter-PSSession command in order to gain access remotely from Linux to Windows.
What am I missing?

@MaximoTrinidad
Copy link

MaximoTrinidad commented Aug 2, 2018

@danielman111

As it was mention before, Openssh need to be setup on the Windows Server. To setup WSMan in Linux, although possible, it's harder compare to just install and configure Openssh in Windows.

In the above comments, is missing the information to setup WSMan for PowerShell in Linux.
I found the following article that may bring some light to your dilema: https://4sysops.com/archives/powershell-remoting-between-windows-and-linux/

:)

@iSazonov iSazonov added Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered. labels Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

5 participants
@danielman111 @kvprasoon @MaximoTrinidad @iSazonov and others