PSRemoting challenge


I have a issue by using new-pssession.
The trust between the machines is setup, wsman is restarted.

When I setup a connection with new-pssession it gives me a acces denied
When I add a enter-pssession it asks me one more time for the server name and the remote session is ok.

I do not understand very well, why it first says “Acces Denied”, and later on the connection is ok .
Can it be that the new-psssion is done by the given credentials and the enter-pssession is using my logged in credentials…?
if I am correct, the remote session uses HTTP unless ohterwise configured
when I use telnet "servername’ 5985 it tells me that this port is open.

I am sure that the given credentials are ok.

$cred = Get-Credential
new-pssession -ComputerName ggwvcdcp001 -Credential $cred 

If I get it right and that’s the code you’re using you’re not using the PSSession you just created. So you actually connected the PSSession with your current account - not the one you provided with Get-Credential. And that’s why you have been asked to provide a computername. :wink:

It should be more something like this:

$cred = Get-Credential
$Session = New-PSSession -ComputerName ggwvcdcp001 -Credential $cred 
Enter-PSSession -Session $Session