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
klsphotosAsked:
Who is Participating?
 
klsphotosConnect With a Mentor Author Commented:
so far nothing automated including that above works.  I ended up doing it manually on the managers (2) systems and the 2 users for now.  I clicked the use alternate credentials.  All works fine but any kind of script powershell or bat does not work.
0
 
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
 
Seth SimmonsSr. Systems AdministratorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: klsphotos (https:#a42479179)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

seth2740
Experts-Exchange Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.