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.