Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mapped Drive Issue

Posted on 2012-03-23
3
Medium Priority
?
447 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
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 22

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

Technology Partners: 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

Let's recap what we learned from yesterday's Skyport Systems webinar.
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
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…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

824 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