You cannot use mydomain\administrator, you have to pass a credential object.
I would also think that with DFS you would need to use the domain name and not an IP address.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
I tested on different Windows versions but it behaves the same way.
Does anyone have any solution or ideas to solve this issue?
Below are the steps that I used to reproduce the problem. I also tried capturing network packets for analysis.
$hostRemote = New-PsSession -Computername 10.44.5.142 -Credential mydomain\administrator
Enter-PsSession $hostRemote
pktmon filter add -t TCP
pktmon start --capture --pkt-size 3072 --file-name C:\tcpdump.etl
New-PsDrive -PsProvider 'FileSystem' -Scope 'Global' -Persist -Name E -Root \\10.44.5.143\dfs1\share1 -Credential mydomain\administrator
pktmon stop
pktmon etl2pcap C:\tcpdump.etl -o C:\tcpdump.pcap
You cannot use mydomain\administrator, you have to pass a credential object.
I would also think that with DFS you would need to use the domain name and not an IP address.