Author Posts

March 24, 2017 at 6:42 am

i am trying to connect to remote computer named 'shubham' which is out of my domain.I have established a connection and tested it but i am stuck at the credential part what should be inserted in the pop up that comes whose username and password?

March 24, 2017 at 9:50 am

You should be using the credentials for the remote machine in the pop up.

March 25, 2017 at 8:48 am

i am using the credential for the remote machine as following:

User-name= Administrator
password = the password used for login in the system

but i am getting the following error
PS C:\WINDOWS\system32> Enter-PSSession -ComputerName shubham -Credential administrator
Enter-PSSession : Connecting to remote server shubham failed with the following error message : Access is denied. For
more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName shubham -Credential administrator
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (shubham:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

March 25, 2017 at 4:57 pm

Since it's out of your domain ie. workgroup computer, you have to make sure you tell both remote and management station to trust each other by modifying the trustedhosts file.

ie. set-item wsman:\localhost\client\trustedhosts or or (* means trust everyone).

set-item wsman:\localhost\client\trustedhosts 192.168.1.100 -concatenate -force or
set-item wsman:\localhost\client\trustedhosts * -force (only use this for testing to prove everything is working)

you can verify by typing:
(get-item wmsan:\localhost\client\trustedhosts).value

This needs to be run on both systems (as well as enabling PSRemoting on target).

March 26, 2017 at 1:55 pm

again i am getting the same error
PS C:\WINDOWS\system32> Enter-PSSession -ComputerName shubham -Credential administrator
Enter-PSSession : Connecting to remote server shubham failed with the following error message : Access is denied. For
more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName shubham -Credential administrator
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (shubham:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

March 27, 2017 at 8:46 pm

Narinda,
Can you tell me what you are remoting into (server/workstation)? You state it's on the outside of your domain, ie. a workgroup system. Please understand that remoting is not enabled by default on the deskop OS's. WinRM is enabled on Server 2012R2, however, you have to tell the workgroup server/workstation to "trust" the management system remoting. If you have older systems, you have to enable the remoting (modify trustedhosts file, allow access through firewall, etc). Your "access denied" suggests perhaps some of this criteria has not been met. Domain remoting and workgroup remoting are VERY different animals.

m

March 28, 2017 at 9:29 am

I am trying to connect to workstation(Laptop) running on windows 10 .I have also windows 10
i have enabled all the prequesites including psremoting,trustedhosts
i have also tried test wsman -computername shubham it`s running

March 28, 2017 at 9:36 am

Have you tried

Username: 'machinename'\administrator

March 28, 2017 at 2:01 pm

I was just going to suggest that! 😀

March 28, 2017 at 2:50 pm

This error came:
Enter-PSSession : A positional parameter cannot be found that accepts argument '\administrator'.
At line:1 char:1
+ Enter-PSSession -ComputerName shubham -Credential 'shubham'\administr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Enter-PSSession], ParameterBindingException

March 28, 2017 at 3:13 pm

1. Did you enable the "Administrator" account on the W10 box? It's disabled by default. I know, I know...just checking
2. $cred=get-credential
3. enter-pssession -computername shubham -credential $cred
or enter-pssession -computername -credential $cred

Cheers!
m

April 6, 2017 at 3:06 pm

# First add the remote computer to list of trusted hosts on this management computer
Set-Item wsman:\localhost\Client\TrustedHosts shubham -Concatenate -Force

$Cred = Get-Credential -UserName 'shubham\administrator'
Enter-PSSession -ComputerName shubham -Credential $Cred

For more information, please read 'The Secrets of PowerShell Remoting' free ebook by Don Jones.