scadoosh
asked on
Mapping Network Drives Across Domains
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.
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.
ASKER
Yes, that would be easiest, but do you know that some companies and people just don't want to do what is easy?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much, it works like a charm!!
ASKER
This should work for multiple users logging on to the same server, as long as the .cmd is edited for their user id, right?
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.cm d call \\server\users\%USERNAME%\ connect.cm d
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..
if you want to get fancy you can do an
if exist \\server\users\%USERNAME%\
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..
Optionally you can establish a trust relationship with the other domain so that you can use the existing user credentials to access the share.