• Status: Open
  • Priority: Medium
  • Security: Public
  • Views: 21
  • Last Modified:

Mapping Azure Storage drive automatically

Hi Experts,

I have a Azure Storage Folder Share and have successfully mapped it to my windows system here at the office and also on our RDS server out in Azure.  I have tested and saved a document to it and can see it on the RDS server.  Works beautifully.

I did this by adding a mapped drive and entering in the credentials and password key of the share.

How can I do this automatically?  

In group policy the "connect as" is greyed out.  When I created a powershell script and ran it it didn't work.

I want the users who log into the RDS server to have this drive show available to them and I want selected users here at the office to have the same drive available to them.  

Thank you,

Karen
0
klsphotos
Asked:
klsphotos
1 Comment
 
Jose Gabriel Ortega CCEO J0rt3g4 Consulting ServicesCommented:
What if you do a bat file.

net use Z:\  \\(azuredrive)  /u:<azureuser> /pwd
And save it into the Start up scripts on the computers (local policy).

Or just Following this script

$acctKey = ConvertTo-SecureString -String "<storage-account-key>" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList "Azure\<storage-account-name>", $acctKey
New-PSDrive -Name <desired-drive-letter> -PSProvider FileSystem -Root "\\<storage-account-name>.file.core.windows.net\<share-name>" -Credential $credential

Open in new window


that is in the documentation (https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows)

I mean setting it as startup script by user on the rdp policies or local policies.
0

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now