Solved

Mapped Drive Issue

Posted on 2012-03-23
3
441 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 166 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 167 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 18

Accepted Solution

by:
Jeremy Weisinger earned 167 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

679 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