Powershell 2.0 Enter-PSSession cannot get New-PSDrive working

1

I have a remote computer which I can Enter-PSSession successfully. When I execute:

New-PSDrive -Name "G" -PSProvider Filesystem -Root '\\fileserver\apps\etc' 

I get the following error:

New-PSDrive : Drive root "\\fileserver\apps\etc" does not exist or it's not a folder.
+ CategoryInfo          : ReadError: (G:PSDriveInfo) [New-PSDrive], IOException
+ FullyQualifiedErrorId : DriveRootError,Microsoft.PowerShell.Commands.NewPSDriveCommand

Now, the location does exist because its mounted on my local computer and remote computer too. Before trying to mount the network drive through Powershell, I typed Get-PSDrive to see if it was mounted before - nothing just the normal.

Is there a way to mount a network drive when you are in PSSession?

K2Chris1983

Posted 2014-11-10T21:34:05.003

Reputation: 11

Answers

0

You have to realize why it fails first. This is second hop issue that causes it.

Several way to fix it:

  • net use on remote box (will prompt for password)
  • enabling kerberos delegation or constrained kerberos delegation
  • enabling CredSSP

This session by Aleksandr Nikolic explains it in more detail.

BartekB

Posted 2014-11-10T21:34:05.003

Reputation: 666

I will take a look at this and get back with you. Thank you for posting this. – K2Chris1983 – 2014-11-12T13:50:05.313