Solved

Map network drive without username and password

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
Synchronize a new Active Directory domain with an existing Office 365 tenant
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
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 …

830 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