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

x
?
Solved

Mapping Network Drives Across Domains

Posted on 2008-10-14
6
Medium Priority
?
280 Views
Last Modified: 2010-04-21
I need to write a script or cmd that will map a network drive from one domain to another in the same forest. Here is the scenario:

They have one userid and domain they log on to on a daily basis, computer is in that domain.
userid #1:  abcd1    domain:  abcd1
They need to get to a server share on another domain with a different user id and password.  
userid #2:  wxyz1  domain:  wxyz1
It maps just fine and their access has been set up, I just need a script that will log them on to this every day, as they are not logging into the computer with userid #2.  
I have used: "net use w: \\server ip address\share" which does map the drive, but I need it to ask them userid and password to authenticate with the correct user id.

So sorry if confusing.
0
Comment
Question by:scadoosh
  • 3
  • 3
6 Comments
 
LVL 1

Expert Comment

by:idez_rsp
ID: 22711324
This may not be the answer you're looking for, but...  Your easiest solution is to use the same user/pass on both domains.  It eliminates a lot of confusion for the end users and also the need to reauthenticate.
Optionally you can establish a trust relationship with the other domain so that you can use the existing user credentials to access the share.
0
 

Author Comment

by:scadoosh
ID: 22711364
Yes, that would be easiest, but do you know that some companies and people just don't want to do what is easy?
0
 
LVL 1

Accepted Solution

by:
idez_rsp earned 2000 total points
ID: 22711667
I understand exactly what you mean.  I've had to argue with users to use passwords at all.
Have you tried
NET USE X: \\SERVER\SHARE /USER:DOMAIN\USERNAME [password or * for prompt]
You can add it to the normal logon script.  To be a bit more secure though I would recomend using the * to prompt for password.  Rather than have it listed in plain text in the logon script in the NETLOGON share that everyone can see.
Optionally make a batch/cmd file that is in the users home directory and call it from the logon script.
logon.cmd  (last line)
call \\server\users\%username%\connect.cmd
 
connect.cmd
net use w: \\server ip address\share /u:wxyz1\wxyz1 password
If you pput the script in the users home folder only they (and admins) will have access and the attachment can be seemless.

 
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Closing Comment

by:scadoosh
ID: 31505870
Thank you so much, it works like a charm!!  
0
 

Author Comment

by:scadoosh
ID: 22715471
This should work for multiple users logging on to the same server, as long as the .cmd is edited for their user id, right?
0
 
LVL 1

Expert Comment

by:idez_rsp
ID: 22717045
Correct.  The only reason I suggest using the home directory is that scripts appear in clear text for anyone to see.

if you want to get fancy you can do an

if exist \\server\users\%USERNAME%\connect.cmd call \\server\users\%USERNAME%\connect.cmd

This would eliminate the line if the connect.cmd file doesn't exist in the users home directory.

This also assumes the user HAS a home directory set under the users profile settings and that you have the users folder shared as users..  
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

A look at what happened in the Verizon cloud breach.
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

783 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