# About credential

**URL:** <https://forums.powershell.org/t/about-credential/8293>\
**Category:** PowerShell Help\
**Created:** [March 24, 2017, 1:12am UTC](https://forums.powershell.org/t/about-credential/8293 "2017-03-24T01:12:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkv16786](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nkv16786](https://forums.powershell.org/u/nkv16786)\
**Post date:** [March 24, 2017, 1:12am UTC](https://forums.powershell.org/t/about-credential/8293/1 "2017-03-24T01:12:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![michaelbender](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/michaelbender/32/216_2.png) [@michaelbender](https://forums.powershell.org/u/michaelbender)\
**Post date:** [March 24, 2017, 4:20am UTC](https://forums.powershell.org/t/about-credential/8293/2 "2017-03-24T04:20:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nkv16786](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nkv16786](https://forums.powershell.org/u/nkv16786)\
**Post date:** [March 25, 2017, 3:18am UTC](https://forums.powershell.org/t/about-credential/8293/3 "2017-03-25T03:18:50Z")

</div>

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
- 

```auto
  + CategoryInfo : InvalidArgument: (shubham:String) [Enter-PSSession], PSRemotingTransportException
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
```

---

<div class="post-metadata">

**Author:** ![sam-boutros](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/sam-boutros/32/5_2.png) [@sam-boutros](https://forums.powershell.org/u/sam-boutros)\
**Post date:** [April 6, 2017, 9:36am UTC](https://forums.powershell.org/t/about-credential/8293/4 "2017-04-06T09:36:22Z")

</div>

```
# 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](https://powershell.org/2012/08/06/ebook-secrets-of-powershell-remoting/) by [Don Jones](https://powershell.org/author/donj/).

---

<div class="post-metadata">

**Author:** ![teskemj](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@teskemj](https://forums.powershell.org/u/teskemj)\
**Post date:** [March 25, 2017, 11:27am UTC](https://forums.powershell.org/t/about-credential/8293/5 "2017-03-25T11:27:36Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![nkv16786](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nkv16786](https://forums.powershell.org/u/nkv16786)\
**Post date:** [March 26, 2017, 8:25am UTC](https://forums.powershell.org/t/about-credential/8293/6 "2017-03-26T08:25:45Z")

</div>

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
- 

```auto

```

- CategoryInfo : InvalidArgument: (shubham:String) [Enter-PSSession], PSRemotingTransportException
- FullyQualifiedErrorId : CreateRemoteRunspaceFailed

---

<div class="post-metadata">

**Author:** ![teskemj](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@teskemj](https://forums.powershell.org/u/teskemj)\
**Post date:** [March 27, 2017, 3:16pm UTC](https://forums.powershell.org/t/about-credential/8293/7 "2017-03-27T15:16:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nkv16786](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nkv16786](https://forums.powershell.org/u/nkv16786)\
**Post date:** [March 28, 2017, 3:59am UTC](https://forums.powershell.org/t/about-credential/8293/8 "2017-03-28T03:59:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mark-prior](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@mark-prior](https://forums.powershell.org/u/mark-prior)\
**Post date:** [March 28, 2017, 4:06am UTC](https://forums.powershell.org/t/about-credential/8293/9 "2017-03-28T04:06:50Z")

</div>

Have you tried

Username: ‘machinename’\administrator

---

<div class="post-metadata">

**Author:** ![teskemj](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@teskemj](https://forums.powershell.org/u/teskemj)\
**Post date:** [March 28, 2017, 8:31am UTC](https://forums.powershell.org/t/about-credential/8293/10 "2017-03-28T08:31:14Z")

</div>

I was just going to suggest that! 😃

---

<div class="post-metadata">

**Author:** ![nkv16786](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nkv16786](https://forums.powershell.org/u/nkv16786)\
**Post date:** [March 28, 2017, 9:20am UTC](https://forums.powershell.org/t/about-credential/8293/11 "2017-03-28T09:20:49Z")

</div>

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 …
- 

```auto
  + CategoryInfo : InvalidArgument: (:) [Enter-PSSession], ParameterBindingException
```

---

<div class="post-metadata">

**Author:** ![teskemj](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@teskemj](https://forums.powershell.org/u/teskemj)\
**Post date:** [March 28, 2017, 9:43am UTC](https://forums.powershell.org/t/about-credential/8293/12 "2017-03-28T09:43:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:38pm UTC](https://forums.powershell.org/t/about-credential/8293/13 "2024-05-16T20:38:58Z")

</div>


