Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mapped Drive Issue

Posted on 2012-03-23
3
Medium Priority
?
446 Views
Last Modified: 2012-03-23
I have a Linux box that has a shared drive I need my Windows users to access. The drive has a username & password to access it. Can someone provide some vbscipt code that will map the drive? The path is \\156.56.23.65\folder and also can I hard code the username & password in the code so the users want have to type it in? This is a Win 2008 server domain with active directory.
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Assisted Solution

by:theberesford
theberesford earned 664 total points
ID: 37756961
a batch using net use command will do that job perfectly :

NET USE X: \\156.56.23.65\folder /USER:domainname\username password
0
 
LVL 11

Assisted Solution

by:X_layer
X_layer earned 668 total points
ID: 37757008
Dim objNetwork
Set objNetwork = WScript.CreateObject("WScript.Network")

Dim strLocalDrive, strRemoteShare, strUser, strPassword

strLocalDrive = "H:"
strRemoteShare = "\\myserver\users"
strUser = "username"
strPassword = "password"
objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, True, strUser, strPassword

Open in new window

Note that True is for storing the mapping persistently in the users profile.
0
 
LVL 21

Accepted Solution

by:
Jeremy Weisinger earned 668 total points
ID: 37757015
You can also use Group Policy Preferences to map the drive. That way you can give access to your users without revealing the password to them since it will be stored in Group Policy.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question