script to map drive across domains

TekChik

Senior member
Jan 15, 2003
839
0
0
I use a simple .bat file in startup for users to map needed drives:

net use L:\\SERVER\share /user:%username% /persistent:no


2 Questions -

First, do i need the persistent? (i didnt create this, so i'm not even sure what that does)

Second, does this work across domains, where the username is the same, but password might be different? If so, will it prompt for a password at login?

TIA,
TekChik
 

tkistre

Senior member
Apr 24, 2001
212
0
0
I am not a Network expert, but a friend of mine just made a .bat file for something similar to you. I can't help with your second question, but maybe on the first. If I understood my friend correctly, when you Run a command, "Persistant" should be set to "Yes" if you want it to start everytime Windows starts. He claims this is not a reliable command. Since you have a .bat file, I don't know if the "Persistant" setting matters, since the .bat is loading everytime Windows starts.
 

spyordie007

Diamond Member
May 28, 2001
6,229
0
0
I would not make it persistant (so leave it like it is) so that in the event the machine is not connected to the network the drive will not appear. If you make it persistant the drive stay there and end up showing up on end users's computers regardless of whether they are connected to the share.

This will use the currently logged in user's credentials so generally it will not work when connected to multiple domains. The way around this would be to setup a trust between the domains so that a user on one domain can have privilages to a share on another domain.

-Erik
 

TekChik

Senior member
Jan 15, 2003
839
0
0
Originally posted by: spyordie007
I would not make it persistant (so leave it like it is) so that in the event the machine is not connected to the network the drive will not appear. If you make it persistant the drive stay there and end up showing up on end users's computers regardless of whether they are connected to the share.

This will use the currently logged in user's credentials so generally it will not work when connected to multiple domains. The way around this would be to setup a trust between the domains so that a user on one domain can have privilages to a share on another domain.

-Erik

well, they ARE trusted domains with the user on both, so that's not a problem. i guess i'm just wondering if i need any further specification in regards to the different domain - i.e. DOMAIN\username instead of just username.

 

spyordie007

Diamond Member
May 28, 2001
6,229
0
0
no need to specify, it will use the credentials of the user account it runs under (the user logging in). So long as their account has access to the share the script wont care.

You can verify they have access to the share by having one of their accounts open up the unc path of it (i.e. \\server\sharename)