Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, July 19, 2017 7:01 AM
Hello there,
after entering a pssession on a server I am not able to retrieve the desired status from the network share ("net use" status unavailable)
I already tried working with Invoke-Command but it's basically the same result. Drive I (network share) is not available.
If I run it on the server directly it says "Status OK" and it's being recognized.
I then tried to add a PSDrive but an error occurs claiming that it's not a folder.
$cred = Get-Credential -Credential "mydomain\myname"
$TargetSession = New-PSSession -ComputerName MyServername -Credential $cred
Invoke-Command -Session $TargetSession -ScriptBlock{net use}
I want to copy files remotely but first off I gotta get the share running.
Thanks in advance.
All replies (6)
Wednesday, July 19, 2017 7:18 AM
That cannot be done in a remote session. Search for "second hop restriction" for more information.
\(ツ)_/
Wednesday, July 19, 2017 7:37 AM
Enable-WSManCredSSP did the job for me, thank you!
Wednesday, July 19, 2017 9:20 AM
Can you tell me how you did it? I am also facing same issue but facing issue even after enabling WSManCred.
Wednesday, July 19, 2017 10:10 AM | 3 votes
1. On PC/Notebook check current status
**Get-WSManCredSSP
**The machine is not configured to allow delegating fresh credentials.
This computer is not configured to receive credentials from a remote client computer.
Enable CredSSP authentication
Enable-WSManCredSSP -Role Client -DelegateComputer *.domain.com
**Get-WSManCredSSP
**The machine is configured to allow delegating fresh credentials to the following target(s): wsman/*.domain.com
This computer is not configured to receive credentials from a remote client computer.
2. Second (middle) server
**Get-WSManCredSSP
**The machine is not configured to allow delegating fresh credentials.
This computer is not configured to receive credentials from a remote client computer.
.. fix this by
Enable-WSManCredSSP -Role Server
**Get-WSManCredSSP
**The machine is not configured to allow delegating fresh credentials.
This computer is configured to receive credentials from a remote client computer.
Should be working.
Sometimes u can get error message, like
.. Connecting to remote server **** failedwith the following error message: The winRM client cannot processs the request. Ac computer policy does not allow the delegation of the user credentials to the target computer because the computer is not trusted.
I think it can be fixed by editing local policy (on your notebook)
Allow delegating fresh credentials with NTLM-only server authentication
Then u can use Invoke-command -computername "targetserver" -credential $creds -authentication CredSSP -scriptblock {get-item [\depotserver\sharedfiles\](file://\depotserver\sharedfiles)*}
Wednesday, July 19, 2017 2:34 PM
In a domain you should not use this without taking all precautions as it can become a security risk which is why it is not enabled by default.
\(ツ)_/
Friday, August 11, 2017 4:46 AM
Hi,
Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.
Best Regards,
Frank
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].