Map network drive, connect as different user to same Server

Got questions? Go ahead: Ask me anything!

I ran into an interesting problem today. I was helping someone configure Samba and had shown him the XP/2000 trick of mapping a network drive and having it connect as a different user. He then wanted to map another network drive to another share on the same server, but this time connect as an entirely different user.

Windows won't do that. You can't use different credentials to connect to different shares on the same server. Once you provide a username and password for an smb server, Windows XP/2K wants to use that for ALL shares on that server.

That's actually a useful feature. For example, I use that to connect printers that otherwise would need authentication. By mapping a share that reconnects at logon, the printers are automatically available because attempting to connect to them will automatically use the same logon/password as the mapped drive did.

But darn it, this person really needed to connect multiple times with different user ids. After some digging, we figured out how to do it: fool Windows into thinking it isn't the same server. One way to do that is to use the ip address for one connection and the smb name for the other, but that only gives you two connections. To get more, you need to add aliases into DNS and configure Samba with the same netbios aliases. With that trick, Windows happily makes multiple connections with different user name/password logons. Basically, it doesn't realize that it is connecting to the same machine.

Got something to add? Send me email.

(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Map network drive, connect as different user to same Server


More Articles by

Find me on Google+

© Tony Lawrence

Wed Nov 1 12:04:03 2006: 2575   anonymous

Thanks for the clue: it does work. But then you have to reenter the password when you want to access the drive for each new session (or I made something wrong in the initial mapping).

Tue Nov 21 04:25:33 2006: 2634   anonymous

Whats a computer?

Tue Mar 6 08:12:22 2007: 2901   anonymous

Yes, when you log off the computer. You open the network drive you have to reenter the password. Do you have another way to not reenter the password ?

Fri May 18 19:40:36 2007: 3000   anonymous

Great information! This was exactly what I was looking for. Thanks for figuring this out.

Sat Aug 11 21:11:17 2007: 3074   anonymous

Great hint, the workaround works well.
If only all posts in forums were so competent.
Can't understand why Windows behaves so silly.

Mon Aug 13 14:58:38 2007: 3075   BigDumbDinosaur

Can't understand why Windows behaves so silly.

Don't feel too bad. Microsoft doesn't understand it either. <Grin>

Tue May 13 14:49:06 2008: 4193   anonymous

has ms blocked this workaround I can not get it to map even when using the ip for one and the servername for the other

Tue May 13 15:24:48 2008: 4194   TonyLawrence

"has ms blocked this workaround"

I believe Vista works differently and this won't do the trick.

Wed May 14 07:16:09 2008: 4195   anonymous

the wrokaround is not working on xpsp3 get the error when refering to the saem server by ip and servername

Fri Apr 3 18:09:20 2009: 5973   anonymous

Your f***ing back button redirect is annoying, and I will never visit this site again.


Fri Apr 3 18:22:11 2009: 5974   TonyLawrence

Can anyone guess what this person is complaining about?

Does he/she mean the "Older" link? What's annoying - or if you do find it "annoying", why use it?

I have no idea what the problem is..

Fri Apr 3 19:37:45 2009: 5978   anonymous

This is a guess, but Mr/Ms Congeniality might be referring to the issue I am seeing with your site in IEv6. I have to click the back button in the browser twice for it to actually go back a page. This doesn't happen on Firefox at home (not sure which version, the latest I assume).

Fri Apr 3 20:10:31 2009: 5979   TonyLawrence

That's almost too funny - he or she is using an ancient browser and blames me for its failings?

Oh well: I've said before that I no longer care about IE6 and its problems (which go way beyond any silly back button issues, by the way).

Still, it is interesting - I wonder what it is that causes that? Here's a thread that blames malware:

But this says it's slow loading ads:
(link) - that seems more likely.

Sat Apr 4 13:23:51 2009: 5984   TonyLawrence

I was thinking about this more and realized that the anger must come because they think I'm doing this deliberately to "trap" them on this site. I suppose even if they had thought to try a different browser (which they ought to be using anyway!) they might still think that..

Too bad.. I wish I could apologize to perhaps calm them down. They must see the same issue at other sites but if anyone know WHY this happens I'd be willing to fix it if it doesn't require tremendous effort. I'm willing to do a *little* work for IE6 users, just not very much :-)

Mon Apr 13 14:26:49 2009: 6153   TonyLawrence

Here's something similar done a different way:


Wed Apr 22 14:27:34 2009: 6255   anonymous

Worked for me too! I'm glad I found your site! Thanks.

Thu Jul 23 00:43:50 2009: 6673   anonymous

Thanks for posting this great tip. It solved that problem for me

Tue Feb 2 01:55:54 2010: 8020   anonymous


Thanks for the idea. Using the IP address is good enough for the "I don't want to reboot" times.
Otherwise, I would recommend you add a small paragraph on how to use the hosts file to add as many local DNS entries as necessary to trick Windows into believing there is so many network servers.

Wed Jun 16 08:19:39 2010: 8704   Farvej


Hi, could you please elobarate this line configure Samba with the same netbios aliases after dns alias for mapping same server with different user names (more than 2 connections)

Wed Jun 16 10:21:41 2010: 8706   TonyLawrence


Well, I'm not sure what you don't understand. First, obviously you need control of your locals dns . If you don't have that, there is nothing you can do. Then you edit the Samba config to add the same aliases. You map your drives to those aliases. It's that simple.

Thu Jul 8 03:43:24 2010: 8800   ianbutton


This was very helpful. Thank you for the tip. Cheers from Down Under.

Mon Oct 4 01:41:23 2010: 9025   anonymous

gravatar solved my problem too........

Sat Jan 15 02:23:39 2011: 9235   anonymous


Still useful 6 years on :D works on Windows 7. Thanks!

Tue Jan 18 21:26:23 2011: 9241   anonymous


This doesn't really work for me and win7 for two reasons which may not be problems for you. First it's a laptop so mapping to a local IP doesn't work since every time they open My Computer it will seek out that mapping. So if they are on another network it will search out that IP, not good. The other problem was that I mapped the My Docs to the server and when connecting to another network then back it would lose the library (there are no folders associated with this library) So I just settled for one mapping.

Mon Jan 24 06:18:25 2011: 9249   Jo


The link is invalid, can you please explain what's the workaround?

Mon Jan 24 13:42:30 2011: 9250   TonyLawrence


(link) also.

That cramsession link is dead. Stupid webmasters...

Thu Aug 11 16:04:17 2011: 9692   anonymous


I'd +1 but Google wants me to login and track me. No thanks.

Thu Aug 11 18:37:32 2011: 9693   TonyLawrence


Thanks for the thought anyway :-)

Mon Sep 12 13:17:19 2011: 9817   anonymous


very useful, is't just i looking for ... Great!!

Wed Sep 14 07:51:19 2011: 9836   Tinminator


things maybe simpler if you try "Net use"

Sat Oct 15 17:18:02 2011: 10034   TylerMorrison


Ok, so an easy fix is changing your network adapter settings to have multiple IP addresses and using a different ip per share. This is technically the easiest and best way to fix your issues.

It's similar to how you do it in XP except you need to go to change adapter settings in Network and sharing center. You then go to the properties of your adapter, double click on IPv4 and then click advanced. Use this to add as many ips as required!

Sat Oct 15 19:42:33 2011: 10035   TonyLawrence


That won't work if you don't have admin access to the machine you need to map.

Wed Nov 2 13:08:20 2011: 10110   anonymous


yes! worked on windows 7.
Just tried using the ip address cause I needed only two logins.
Thanks for the great idea!

Kerio Samepage

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

privacy policy