Drive mapping scripts

Associate
Joined
28 Sep 2005
Posts
1,282
Location
London
I have got the basic "net use U: /del" "net use U: \\server\share"

BUT that tries to map the drive using the current user name and password. I need to use another username and password, this is just a click in windows, but unfortunately i have very many of these to do and would prefer to script it.

Is it "NET USER *username* *Password*" i use for this??



Many thanks in advance.
 
Associate
Joined
28 Jun 2005
Posts
895
net use /?

that says you can add /user:usernamehere to do it, I don't have another pc to map to at the moment so I can't confirm
 
Soldato
Joined
10 Jan 2004
Posts
21,921
Location
All over
Putting plain text passwords into batch files is the dirtiest thing ever. Ever. I'd suggest taking a look at securing the resource another way.
 
Associate
OP
Joined
28 Sep 2005
Posts
1,282
Location
London
the script is stored on a server in domain environment. So it's not easy to get to, and it's only temporary until we go server 2003 on that domain.
It's only a minor server churning out pathology result lookups to an application. The data itself has to be read using the client side software which is tightly licenced.
 
Last edited:
Soldato
Joined
10 Jan 2004
Posts
21,921
Location
All over
Skilldibop said:
the script is stored on a server in domain environment. So it's not easy to get to
LOL, only to any authenticated user (and potentially anonymous connections), regardless of permissions.

Skilldibop said:
and it's only temporary until we go server 2003 on that domain.
Well, I hope that's not too far away. I wouldn't do it even for a day, but then I'm quite security conscious.

[edit]
Skilldibop said:
It's only a minor server churning out pathology result lookups to an application. The data itself has to be read using the client side software which is tightly licenced.
Not the application that's the problem. You've potentially exposed domain credentials to anyone.
 
Associate
OP
Joined
28 Sep 2005
Posts
1,282
Location
London
it's not in the netlogon share, nor is it connecting to a domain controller. It's in a mapped network drive to a share the server, it's executed in startup. It's not set like a logon script in the netlogon share. If logon scripts worked between XP and NT server i wouldn't have the problem.
 
Permabanned
Joined
17 Mar 2004
Posts
1,486
Location
Edinburgh
Maybe a more efficient way of doing it would be to get the "minor server" to use the domain for authentication and give the users access to it? Would mean that you could just use existing credentials to map the drive.
 
Associate
OP
Joined
28 Sep 2005
Posts
1,282
Location
London
M0KUJ1N said:
Maybe a more efficient way of doing it would be to get the "minor server" to use the domain for authentication and give the users access to it? Would mean that you could just use existing credentials to map the drive.

That wouldn't work. Primarily because the minor server is servicing most of it's users under a netware environment (on a different site to this windows domain on server NT) and the server itself is Server2003 thus is in a workgroup as far as it is concerned. It will be encorporated into Active directory when the major netware to server 2003 migration happens later this year involving all 20+ servers across the group. This is why we don't really want to be messing around with domains at this point. The server NT system will be migrating to server 2003 next friday, and the 2003 logon scripts work fine with XP and can map the drive. The main issue being that XP sees NT logon scripts as inferior in security and won't execute them other than mapping the home directory. as of next weekend it won't be an issue, which is why i'm not taking servers down and adding them to domains for the sake of a week.
 
Soldato
Joined
7 May 2003
Posts
4,247
Location
Away from here
Skilldibop said:
The main issue being that XP sees NT logon scripts as inferior in security and won't execute them other than mapping the home directory.

I've still get an NT 4 domain running on a seperate LAN using some old equipment and I can login with an XP Pro client and the logon script executes fine.
 
Soldato
Joined
10 Jan 2004
Posts
21,921
Location
All over
^^ What he said... A batch script, a kix script... whatever, it's still a collection of Win32 commands, and XP should execute it regardless. I've never had any trouble, and I work in all sorts of wierd and wonderful domain environments.

I move all my scripting to Visual Basic these days, but that's another story.
 
Associate
OP
Joined
28 Sep 2005
Posts
1,282
Location
London
Otacon said:
^^ What he said... A batch script, a kix script... whatever, it's still a collection of Win32 commands, and XP should execute it regardless. I've never had any trouble, and I work in all sorts of wierd and wonderful domain environments.

I move all my scripting to Visual Basic these days, but that's another story.

Well for some reason ServerNT logon scripts don't execute on XP Pro Clients. Or at least not with static profiles. It mapped 3 drives, and ignored all the others. Worked fine on NT but not XP. All users have a logon script assigned still and nothing happens. But as has been said many times, once the new server 2003 box goes live next friday it'll all be done properly.

Edit: i originally tried doing a .VBS but my VB is a little rusty. Dim this, Things.Stuff
.bat was the one i could remeber the commands for.
 
Last edited:
Back
Top Bottom