How to Mount Azure Fileshare Automatically to Windows Server VM

Leland Ballard 2 Reputation points
2022-08-01T18:08:11.997+00:00

Good Afternoon,

I am wanting to have an Azure File Share automatically mounted to a VM as a share drive (for example, Z:Drive). I tried to use the Connect PowerShell script for the file share to run at the startup via GPO (all VMs are hosted in Azure via Windows Server 2019 DC ). This was unsuccessful. What other options are there? I don't care if it's via user policy or computer policy. It can be when the VM is started, when a user logs in, or something else. Thanks!

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,741 questions
Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,162 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,687 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,119 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,848 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2022-08-03T07:10:19.607+00:00

    Hi,

    Please see the link below for a guide on how to achieve this:

    https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows

    I hope this answers your question.

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

    --If the reply is helpful, please Upvote and Accept as answer--


  2. Andreas Baumgarten 96,266 Reputation points MVP
    2022-08-03T10:45:41.427+00:00

    Hi @Anonymous ,

    what does This was unsuccessful. mean? You got an error message? Or what went wrong?

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  3. Narender Uppala 21 Reputation points
    2022-10-28T05:58:48.457+00:00

    I also need a solution for this.

    0 comments No comments

  4. Dirk Haex 81 Reputation points
    2022-10-28T21:09:45.987+00:00

    Try placing the script in the user startup folder: C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    You can achieve this by a copy action on the GPO preference section of the user part.

    When running this script as administrator, you are in fact mapping this drive to another session, not visible in your Windows Explorer.


  5. Ronak Parmar 0 Reputation points
    2023-04-12T09:46:40.48+00:00

    Thank you for providing Azure Files related information that is such a helpful.

    0 comments No comments