SMB drive access problem within Administrator PowerShell terminal


Mounting a remote SMB drive under a regular user, then trying to access it via the Administrator account within PowerShell results in the following error:

dir : Cannot find path '\\\dir' because it does not exist.

To resolve this problem, use the net use command under an Administrator PowerShell terminal.


SMB drive mounted via the GUI under the local user account:

smb mount

Attempting to access the share under the Administrator PowerShell user generates the following error:

(base) PS C:\Users\jemurray\Documents\JasonMurrayPerfTesting> dir \\\dir
dir : Cannot find path '\\\dir' because it does not exist.
At line:1 char:1
+ dir \\\dir
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (\\\dir:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

To resolve this issue, first unmount the drive. Then remount it under the Administrator PowerShell terminal using the net use command:

(base) PS C:\Users\jemurray\Documents\JasonMurrayPerfTesting> net use Z: "\\\dir"
The password or user name is invalid for \\\dir.

Enter the user name for '': domain\jemurray
Enter the password for
The command completed successfully.

Confirm access functions as expected:

(base) PS C:\Users\jemurray\Documents\JasonMurrayPerfTesting> dir z:\

    Directory: z:\

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         6/5/2020   9:52 AM                Active
d-----        5/22/2020   3:26 PM                Archive