6

I want to use winrm remote vm, I can connect to the localhost, but I can't connect to the other remote machine, the error is "access is denied".

Please help me. enter image description here

Willie Cheng
  • 7,679
  • 13
  • 55
  • 68
Hoi Fong Iam
  • 63
  • 1
  • 1
  • 4

2 Answers2

8

You need to provide -Credential parameter:

Enter-PSSession –ComputerName Server –Credential Domain\UserName
Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52
5

So I was having the EXACT same issue as this user and found the issue. Basically I was running the commands as my Domain Admin account but the servers are locked down to not accept network connections from Domain Admin accounts in Group Policy as a security measure. Once changing the command credentials to run as my non domain admin account and an account allowed network access with administrative permissions the enter-pssession command worked perfectly. What I don't understand is why the test-wsman command appears to work.

Jamie Lawson
  • 53
  • 2
  • 5