Cannot access network drive in PowerShell running as administrator Cannot access network drive in PowerShell running as administrator powershell powershell

Cannot access network drive in PowerShell running as administrator


In the end the fix was simply to re-map the drive letter while running as Administrator:

net use Z: "\\vmware-host\Shared Folders"

It doesn't have to be done from the same PowerShell instance (or from PowerShell at all) - it's just something that needs to be done once for the entire logon session.


In my case, I was able to simply use the UNC path instead of the drive mapping and it worked fine.

So, per your example, instead of using the mapped drive Z:\, I just used "\\vmware-host\Shared Folder" as the path.


One other work-around that took me ages to find is to run net use from a scheduled task as the NT AUTHORITY\SYSTEM account. Apparently drives mapped under this account show up for all users and all elevation levels.

I've tested this and it works even on NFS shares (which can be a bit finicky). Just create a scheduled task set to run at system startup, and specify the usual command:

net use Z: \\server\share /persistent:no

It might possibly work to run it just once with /persistent:yes, but I haven't tried that. Granted, "just map it again" works too, but that drive still won't be visible to scheduled tasks running in different contexts. The downside is that all real users see it too, so not so good for multiuser setups.