Azure File share mounted drive showing Disconnected Network Drive

Dnyaneshwar Surywanshi 156 Reputation points
2021-06-13T17:16:53.273+00:00

I am using Microsoft Azure Fluent API with RunPowerShellScript method to execute powershell script. My file share drive mounted properly but it's showing disconnected .When i click on disconnected drive it's showing files properly. But same powershell command when i run from virtual machine it's working properly.Please see below image :

105172-filedrivenotmount.png

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,302 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,994 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,553 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 47,021 Reputation points Microsoft Employee
    2021-06-14T10:29:08.407+00:00

    @Dnyaneshwar Surywanshi Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Based on the Issue there could be several reason: If you map a drive to a network share, the mapped drive may be disconnected after a regular interval of inactivity, and Windows Explorer may display a red X on the icon of the mapped drive. However, if you try to access or browse the mapped drive, it reconnects quickly.

    Mapped drive connection to network share may be lost

    In Registry Editor, locate and then click the following registry subkey:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
    • Right-click Configuration, click New and then click DWORD (32-bit) Value.
    • Name the new registry entry as EnableLinkedConnections.
    • Double-click the EnableLinkedConnections registry entry.
    • In the Edit DWORD Value dialog box, type 1 in the Value data field, and then click OK.

    Exit Registry Editor, and then restart the computer.

    https://support.microsoft.com/en-gb/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows

    Additional information Step 2: If the issue still perists - Locate and then click the following key in the registry:

    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
    • In the right pane, click the autodisconnect value, and then on the Edit menu, click Modify. If the autodisconnect value does not exist, follow these steps:
    • On the Edit menu, point to New, and then click REG_DWORD.
    • Type autodisconnect, and then press ENTER.
    • On the Edit menu, click Modify. We tried to set the decimal value to -1 but it would not allow.
    • Click Hexadecimal.
    • In the Value data box, type ffffffff, and then click OK.
    • We ran net config server /autodisconnect:-1 on a command prompt instance.
    • Change the NTLM authentication level .Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Network security: LAN Manager authentication level changed to “Send LM & NTLM - use NTLMv2 session security if negotiated”.
    • We then confirmed the NTLM version in the registry was properly set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

    Also cross verify- NTLMv2: NTLM version 2 must be enabled to use Azure File Share:
    If HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\LmCompatibilityLevel is set to 3 4 or 5
    You can set the NTLM level via GPO as detailed in this article

    If the issue still persists, can you please across verify the details mentioned on this article.

    Also provide the information mentioned below for future troubleshooting step:

    1. Is this a new deployment?
    2. What was the last change done before you started seeing this issue?
    3. Does the issue always happen, or is it sometimes possible to connect to the share?
      I wish to engage with you offline for a closer look and provide a quick and specialized assistance,

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.

    -----------------------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


  2. Geertjan Schotpoort 1 Reputation point
    2022-02-09T16:38:35.03+00:00

    Had the exact same issue. Turns out it was the NTLM auth level as was pointed out in de post above.

    0 comments No comments

  3. Andrey Jackiechanov 0 Reputation points
    2024-09-17T14:17:09.9833333+00:00

    Exactly the same issue here. I deployed Azure Virtual Desktop. When deploying PS scripts with Intune, I get the exact same behavior. Windows Explorer doesn't show me anything with a "connected" status icon. It appears to be disconnected, but accessible when you open it. The icon doesn't change afterwards. As a result, I can't connect or disconnect this drive. I've gone through all the above advice, but it doesn't help.

    Has anything improved since 2022??

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.