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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CastroCEOCommented:
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
klsphotosAuthor 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage

From novice to tech pro — start learning today.