cpl1993
cpl1993

Reputation: 13

Impossible to invoke command on a server (Powershell)

I've got a problem, i can't execute a powershell command in remote.

Invoke-Command -ComputerName MYCOMPUTER -Credential MYDOMAIN\MYUSER -ScriptBlock {Get-Culture}

and this is my error log:

Winrs error:WinRM cannot process the request. The following error occured while using Kerberos authentication: The network path was not found.

Possible causes are:

-The user name or password specified are invalid. -Kerberos is used when no authentication method and no user name are specified.

-Kerberos accepts domain user names, but not local user names. -The Service Principal Name (SPN) for the remote computer name and port does not exist.

-The client and remote computers are in different domains and there is no trust between the two domains. After checking for the above issues, try the following:

-Check the Event Viewer for events related to authentication. -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.

I've got full rights on the server, i did "Enable-PSRemoting -Force" in admin, ,WinRm quickconfig" too, and i can ping the server and connect at it.

It's strange because i can do it on another server which has the same version of Windows (Windows Server 2008 R2) and the same version of powershell (2.0). Could you help me please ?

Thanks

Upvotes: 1

Views: 4557

Answers (1)

Ranadip Dutta
Ranadip Dutta

Reputation: 9183

You can verify the availability of trusted hosts :

  1. Start Windows PowerShell as an administrator by right-clicking the Windows PowerShell shortcut and selecting Run As Administrator.

  2. At the PowerShell prompt, you can verify that the WinRM service is running using the following command:

    get-service winrm

The value of the Status property in the output should be “Running”.

  1. To configure Windows PowerShell for remoting, type the following command:

    Enable-PSRemoting –force

Use the below command to add the remote systems under trusted hosts:

winrm s winrm/config/client '@{TrustedHosts="RemoteComputer"}'

Then you can check the same using the below command:

winrm quickconfig

Reference Link : Enabling Remoting in Powershell

Upvotes: 1

Related Questions