Search code examples
powershellazure-storageazure-blob-storage

Can't map Azure drive storage as netword drive using PowerShell


I'm first testing the connection to the storage over port 445:

Test-NetConnection -ComputerName myshare.file.core.windows.net -Port 445

ComputerName : myshare.file.core.windows.net RemoteAddress : 55.111.11.152 RemotePort : 445 InterfaceAlias : Ethernet SourceAddress : 192.168.47.204 TcpTestSucceeded : True

So, everything seems OK, buth then:

New-PSDrive -Name F -Persist -PSProvider FileSystem -Root "\\myshare.file.core.windows.net\myfolder"

New-PSDrive : The network name cannot be found At line:1 char:1 + New-PSDrive -Name G -Persist -PSProvider FileSystem -Root "\\myshare ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (G:PSDriveInfo) [New-PSDrive], Win32Exception + FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand

Any ideas?


Solution

  • Ok, for future users desperate as I was, I found the solution. The value of registry key

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\lmcompatibilitylevel

    must be set to 3. Now it works.