Starting a remote session on localhost

Hi, I’m very new to PowerShell and I’ve been following the “Learn PowerShell in a Month of Lunches” book, but got stuck on trying to start a remote session on my own computer or localhost. When I put in:

Enter-PSSession -computername localhost

I get this error:

did you add the remote machine to trusted list??

Probably not, but how would I check that? and do you have to always add the target computer to the trusted list for remoting?

Shouldn’t your own computer or localhost be on that trusted list already?

Hi Ben,

Have you tried

 New-PSSession localhost 

It should then list the session if successful?

I get the same type of error message:

Is the Windows Remote Management service running on the local machine? If so, try restarting it and see if the error persists, more things to make sure, are you admin on local machine etc.

Here’s what i got:

Hi Ben,

Ok, try adding it to the list of trusted hosts, although i’d be unsure as to why it thinks a localhost is an untrusted domain,

anyway, try using this command to add your machine to the trusted host list. Let me know how it behaves.

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

Didn’t work :frowning: