invoke-command from Cent OS 7.4 to Windows 2012 R2 Access Denied

PS /tmp> invoke-command -Computername tgcs010 {get-process} -credential administrator

PowerShell credential request
 Enter your credentials.
 Password for user administrator: ********

invoke-command : MI_RESULT_ACCESS_DENIED
 At line:1 char:1
•invoke-command -Computername tgcs010 {get-process} -credential admini ...

•CategoryInfo : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
•FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand

PS /tmp>

MY Version running on CENT OS 7.4

PS /tmp> $PSVersionTable

Name Value

PSVersion 6.0.0-rc.2
 PSEdition Core
 GitCommitId v6.0.0-rc.2
 OS Linux 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon D...
 Platform Unix
 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
 PSRemotingProtocolVersion 2.3
 WSManStackVersion 3.0

On my Windows 10 computer same command works

I domain joined the Cent OS server to my Windows Domain also.

What am I missing?

Thank you
LVL 23
Thomas GrassiSystems AdministratorAsked:
Who is Participating?
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Remoting needs to be enabled on the target systems only, so you should be fine without on CentOS (for this purpose).

The whole topic of PS Remoting is still fresh and only partially implemented, AFAIK. According to, you cannot use Kerberos, which is the default for domain-joined machines, but have to provide Basic or NTLM authentication instead, by just adding -Authentication Basic or -Authentication Negotiate.
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
You are using "administrator" that should be "domain\administrator":
invoke-command -Computername tgcs010 {get-process} -credential "domain\administrator"

Open in new window

try again with your domain credentials.
Thomas GrassiSystems AdministratorAuthor Commented:
Same results

PS /root> Invoke-command -computername tgcs011 {get-process} -Credential "our\administrator"

PowerShell credential request
Enter your credentials.
Password for user our\administrator: ********

At line:1 char:1
+ Invoke-command -computername tgcs011 {get-process} -Credential "our\a ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [Invoke-Command], PSInvalidOperationException
+ FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.InvokeCommandCommand

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
Thomas GrassiSystems AdministratorAuthor Commented:

Powershell remoting in on in all my Windows servers

From my Windows 10 computer I can invoke-command and enter-possession to any server in any domain.

Just not from the Cent OS machine.

How do I enable psremoting on Cent OS?

 Been on GritHub site could not find anything there either.


PS /root> enable-psremoting
enable-psremoting : The term 'enable-psremoting' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ enable-psremoting
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (enable-psremoting:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Any ideas?
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
So in resumen:

Invoke-command -computername tgcs011 {get-process} -Credential "our\administrator"  -Authentication Basic (-Authentication Negotiate.)

Open in new window

(I didn't know about the psremoting on unix). Either way, as Qlemo said it's only in the "Target" OS not in the source one.
Thomas GrassiSystems AdministratorAuthor Commented:
According to GitHub you need to use openssh on windows servers

sub -computername with -hostname

does any one have this working?

I can now ssh from my Cent OS 7.4 server to my Windows 2012 R2 server

but the invoke-command and enter-possession still do not work
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
SSH is another way to remote connect, not the only one.
Thomas GrassiSystems AdministratorAuthor Commented:
Having it working using ssh but that is not the method I need
Waiting for MS to fix this
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.