Solved

Map network drive without username and password

Posted on 2008-10-28
5
1,876 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 500 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. 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

Suggested Solutions

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This article runs through the process of deploying a single EXE application selectively to a group of user.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now