Solved

Mapping Network Drives Across Domains

Posted on 2008-10-14
6
230 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 500 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

919 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