Author Posts

June 2, 2017 at 2:32 am

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:

https://ibb.co/b0invv

June 2, 2017 at 5:24 pm

did you add the remote machine to trusted list??

June 3, 2017 at 1:58 am

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?

June 5, 2017 at 11:25 am

Hi Ben,

Have you tried

 New-PSSession localhost 

It should then list the session if successful?

June 5, 2017 at 3:08 pm

I get the same type of error message:

https://ibb.co/dn4uAv

June 6, 2017 at 9:05 am

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.

June 7, 2017 at 7:44 am

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"}'