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

x
?
Solved

Map network drive without username and password

Posted on 2008-10-28
5
Medium Priority
?
1,896 Views
Last Modified: 2013-12-02
I want to create a login script on Windows Server 2003 which maps a network drive to each user workstation as the user logs into the machine.

The path to the share I want to mount is \\<server-ip-address>\alfresco

and the contents on the mapped drive changes according to the username and password provided to the remote server for authentication.  The usernames and passwords for the remote server are different to those for the workstation login against Active Directory.

How can I map the network share as a placeholder for each user?  I want the drive to be mounted for each user by the login script and then for them to provide the appropriate username and password to it when they first access it (i.e. via a dialog box which comes up when they first double click the drive in My Computer).

Is this possible?  Alternatively, can I use /persistent in the net use command on the login script to mount the drive and have the user name and password remembered for that user permanently once they have entered it once?

Many thanks for any help.
0
Comment
Question by:evbuk
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:szaibot
ID: 22823193
You might want to do something like it.
You will need file IFMEMBER.exe from here
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en


---LOGIN SCRIPT FILE---

                     SET OUTFILE=

echo.# SYNCHRONISING TIME TO BHS DOMAIN #

:TIME
NET TIME /DOMAIN:DIRECTORSSECRET /SET /YES

IFMEMBER "yourdomain\securitygroup1"
      IF NOT ERRORLEVEL 1 GOTO NO_SHARE1
      IF EXIST Z:\*.* NET USE Z: /D %OUTFILE%
      NET USE Z: \\server\share1 /PERSISTENT:NO %OUTFILE%
:NO_SHARE1


IFMEMBER "yourdomain\securitygroup2"
      IF NOT ERRORLEVEL 1 GOTO NO_SHARE2
      IF EXIST s:\*.* NET USE s: /D %OUTFILE%
      NET USE s: \\server\share2 /PERSISTENT:NO %OUTFILE%

:NO_SHARE2


IFMEMBER "yourdomain\securitygroup3"
      IF NOT ERRORLEVEL 1 GOTO NO_SHARE3
      IF EXIST P:\*.* NET USE P: /D %OUTFILE%
      NET USE P: \\server\share3 /PERSISTENT:NO %OUTFILE%

:NO_SHARE3

goto exit

:EXIT
0
 
LVL 2

Expert Comment

by:szaibot
ID: 22823218
Not exactly sure if that helps you, as I see the logins are different on workstations and server.
0
 

Author Comment

by:evbuk
ID: 22823337
Thanks for the reply, but as you say, it doesn't help.
This is an authentication against a remote server, not part of the current Active Directory.
0
 
LVL 10

Accepted Solution

by:
fm250 earned 2000 total points
ID: 22823460
why don't you add the remote server as member domain and save time -if it is yours-.
You can also put a script that include the username and password to map the remote share on the start up for each user.  
0
 

Author Comment

by:evbuk
ID: 22823842
I like the above idea but I connect to the server through a VPN at the moment which I don't think will work with adding to the Active Directory domain.

Is there a way to store a different user name and password for a user in Active Directory - perhaps with a variable - so that I could specify the password for the remote server for each user in their AD profile and pull this into the login script?
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 process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

963 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