0

I'm connecting with PowerShell from my computer to a remote computer (10.44.5.142) and trying to mount a DFS share there (\10.44.5.143\dfs1\share1). It doesn't work correctly - I get error "A specified logon session does not exist. It may already have been terminated".
The root cause seems to be the combination of DFS share and remote PS session, because mounting a basic non-DFS share through PS remote session works fine. Also, mounting the DFS share directly on the computer (without PsSession) works fine.

Does anyone have any solution or ideas to solve this issue?

I tested on different Windows versions but it behaves the same way.

Below are the steps that I used to reproduce the problem. I also tried capturing network packets for analysis.

From my computer connect to the remote computer

$hostRemote = New-PsSession -Computername 10.44.5.142 -Credential mydomain\administrator
Enter-PsSession $hostRemote

Start packet capture

pktmon filter add -t TCP  
pktmon start --capture --pkt-size 3072 --file-name C:\tcpdump.etl

Mount the network share (it fails with error "A specified logon session does not exist. It may already have been terminated")

New-PsDrive -PsProvider 'FileSystem' -Scope 'Global' -Persist -Name E -Root \\10.44.5.143\dfs1\share1 -Credential mydomain\administrator

Stop capture and convert etl to pcap file (for viewing in wireshark)

pktmon stop
pktmon etl2pcap C:\tcpdump.etl -o C:\tcpdump.pcap
simhro
  • 1
  • 1
  • 2
  • By default, you cannot access the network from a remote PowerShell session, which is known as the double-hop problem. See if [this post](https://stackoverflow.com/q/17813002/45375) helps, or [this one](https://stackoverflow.com/a/25349359/45375). – mklement0 May 15 '23 at 14:08

0 Answers0