Solved

Map network drive without username and password

Posted on 2008-10-28
5
1,870 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
Comment Utility
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
Comment Utility
Not exactly sure if that helps you, as I see the logins are different on workstations and server.
0
 

Author Comment

by:evbuk
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Learn about cloud computing and its benefits for small business owners.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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 …

771 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

10 Experts available now in Live!

Get 1:1 Help Now