0

I have two machines: Machine A(Windows Server 2012 R2) and Machine B.(Windows 10)

We use Machine A to host an ASP.NET Web application, Machine B is my development machine

Both A and B are behind a corporate firewall and are joined to an Active Directory domain.

When I try to mount a PS drive on Machine B pointing to a location on machine A with the following command:

New-PSDrive "Kablam" -PSProvider FileSystem -Root \\A\F$\Install -Credential $cred

I get an access denied Error:

New-PSDrive : Access is denied
At line:1 char:1
+ New-PSDrive "Kablam" -PSProvider FileSystem -Root \\A ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Kablam:PSDriveInfo) [New-PSDrive], Win32Exception
    + FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand

The $cred variable contains the credentials of a Local administrator user defined on Machine A which have been granted explicit full control over the \\A\F$\Install path

When I try the similar command with my domain credentials it works fine.

Why is this happening? Is there special permissions to grant to local users to allow them to mount Ps drives?

FYI Why are we mounting a PSDrive ?

Deployment on Machine A are automated with Azure DevOps. Our deployment pipeline uses the Copy Windows Machine File Task that uses New-PSDrive under the hood.

Chedy2149
  • 223
  • 4
  • 14
  • Do you explicitly state that the user is a local user? `.\username` instead of `username` – sippybear Mar 13 '20 at 22:06
  • @sippybear yes actually the use is fully qualified with the machine's name `A\username` – Chedy2149 Mar 15 '20 at 19:38
  • 1
    Can you rule out permission problems by adding the mapped drive using `net use` or via the GUI (Windows Explorer)? Just in case you didn't forget to modify either of NTFS ACLs or SMB permissions. – Daniel Mar 16 '20 at 15:24

0 Answers0