I have a server Windows 2012R2 in the domain. This server has no domain user access, only local admin user. I can RDC into this machine using admin account, but cannot have a PSSession, so Enter-PSSession or Invoke-Command or New-PSSession does not work. I have set the Trustedhosts value to '*' already. Still does not work.

The example:

$cred = Get-Credential # username: Aministrator, password: secret123
Enter-PSSession -computername SVR1 -Credential $cred

Immediately I get error:

Enter-PSSession : Connecting to remote server SVR1 failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.

Why I cannot login to the server with local admin acount?


After the comment below, I have tried, SVR1\ADMINISTRATOR as username, then I go a different error message:

Enter-PSSession : Connecting to remote server SVR1 failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: We can't sign you in with this credential because your domain isn't available. Make sure your device is connected to your organization's network and try again. If you previously signed in on this device with another credential, you can sign in with that credential. 
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. Note that computers in the TrustedHosts list might not be authenticated. 
    -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
  • Have you tried "COMPUTERNAME\Administrator" as the username? – Glenn Sullivan Apr 4 at 15:22
  • I have tried your suggestion, and different error came, I have added the error in the question as the error volume was big. – Dilshad Abduwali Apr 4 at 15:34
  • why not enable psremoting on the server. you may try to run winrm quickconfig – Rajiv Iyer Jul 5 at 10:52

Here's a guide: https://4sysops.com/archives/enable-powershell-remoting-on-a-standalone-workgroup-computer/

And a summary of the main points:

  • Make sure the network type on the remote server is not "Public". Since it's not on a domain, you'll probably want to make sure it is "Private". Instead, you can make sure you added -SkipNetworkProfileCheck when you enabled psremoting.
  • On the client (where you're initiating from), enter the remote server's IP to the trusted hosts. E.g., winrm set winrm/config/client @{TrustedHosts=""} at an elevated command prompt (make sure to change that IP to the one in your environment).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.