1
votes

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?

2
May I know the PS version? Workstation service was set to manual and checkSumanthMarigowda-MSFT
@SumanthMarigowda-MSFT Yes, of course, it's 5.1.14393.2828Oscar

2 Answers

1
votes

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.

0
votes

You should use a UNC path via add \\, it will be like this,

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

I add the storage account credentials and map azure file share on windows server 2016 Azure VM. enter image description here Reference: https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows#mount-the-azure-file-share-with-powershell