1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drive mapping scripts

Discussion in 'Windows & Other Software' started by Skilldibop, 18 Jan 2006.

  1. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    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.
     
  2. |Ric|

    Hitman

    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
     
  3. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    Location: London

    yeah i've fixed it already "net use X: \\server\share password /USER:userx/domainName" was what i was looking for :)
     
  4. Otacon

    Capodecina

    Joined: 10 Jan 2004

    Posts: 21,923

    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.
     
  5. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    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: 18 Jan 2006
  6. Otacon

    Capodecina

    Joined: 10 Jan 2004

    Posts: 21,923

    Location: All over

    LOL, only to any authenticated user (and potentially anonymous connections), regardless of permissions.

    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]
    Not the application that's the problem. You've potentially exposed domain credentials to anyone.
     
  7. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    Location: London

    go live is next friday. and all authenticated users have access to the application anyway so it makes no odds.
     
  8. |Ric|

    Hitman

    Joined: 28 Jun 2005

    Posts: 895

    perhaps you could at least make it difficult and hide it in an exe (then just run that net command)
     
  9. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    Location: London

    not really worth the hassle fow what it is. They leave the PCs logged on and the app open anyway. Security is pointless beyond that.
     
  10. Burnsy2023

    Man of Honour

    Joined: 17 Nov 2003

    Posts: 36,533

    Location: Southampton, UK

    I agree with Otacon, not only is it very bad practice but there are no doubt better ways to do this.

    Any authenticated user can pull up the netlogon share from a DC and view the contents

    Burnsy
     
  11. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    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.
     
  12. M0KUJ1N

    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.
     
  13. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    Location: London

    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.
     
  14. Burbleflop

    PermaBanned

    Joined: 7 May 2003

    Posts: 4,247

    Location: Away from here

    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.
     
  15. Otacon

    Capodecina

    Joined: 10 Jan 2004

    Posts: 21,923

    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.
     
  16. Skilldibop

    Wise Guy

    Joined: 28 Sep 2005

    Posts: 1,284

    Location: London

    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: 19 Jan 2006
  17. Burbleflop

    PermaBanned

    Joined: 7 May 2003

    Posts: 4,247

    Location: Away from here

    Yeah, they do. Static or roaming profiles makes no difference. Anyway, like you said, all kinda irrelevant as of the end of next week.