Accessing a Windows share with a different username

462,975

Solution 1

Yes, it is.

When you map the network share from Windows Explorer (right click on share name > Map network drive) you can use different user credentials:

Map network share

You can also do it via command prompt (started as administrator):

net use [drive] [share] /user:[user] [password]

Example:

net use s: \\homesrv\share /user:vp pass123

Solution 2

To delete saved share usernames:

open cmd prompt type:
net use \\fileservername /del
or
net use * /del
to delete all

found @ http://www.windowsnetworking.com/kbase/WindowsTips/WindowsServer2008/AdminTips/Network/DeleteLoginCredentialsforaNetworkShare.html

Solution 3

The comment to the top answer is a good solution, it does not require mapping network drive, just tries to access the directory with different user account and password, which meets my need. Quoting the comment to here :
""""""""""""
...connect to a network share using separate credentials without mapping to a drive letter . . .: net use \\<server>\<sharename> /USER:<domain>\<username> * Note that with this set of parameters, you must either specify the password or use the asterisk to signify that you want to be prompted...
""""""""""""
I tried * and also replacing * with password, both worked well

Share:
462,975

Related videos on Youtube

Mahdi Alkhatib
Author by

Mahdi Alkhatib

Updated on September 18, 2022

Comments

  • Mahdi Alkhatib
    Mahdi Alkhatib over 1 year

    Is it possible to manually specify the username, in which Windows uses it when connecting to a networked share?

    perhaps \\username@host\...

    PS: Both the server and clients run Windows 7.

  • Mark Jeronimus
    Mark Jeronimus over 8 years
    The GUI method complains "The network folder specified is currently mapped using a different user name and password. To connect using a different user name and password, first disconnect any existing mappings to this network share." — No it's not! I only accessed it with explorer, it's not mapped. The CMD method complains "Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again."
  • DavidPostill
    DavidPostill about 8 years
    Welcome to Super User! Please read the question again carefully. Your answer does not answer the original question. The OP is not asking about deleting shares and your answer doesn't even mention user names which he did ask about.
  • GetFree
    GetFree over 7 years
    @MarkJeronimus, look here support.microsoft.com/en-us/kb/938120 TL;DR: You have to use the computer's IP, not it's network name.
  • Alex
    Alex about 7 years
    @MarkJeronimus Open your Windows user settings, click "Manage credentials", and see if the share is listed under Windows Credentials. If so, you should be able to modify or remove the stored login there. One problem of the GUI method is that it forces the assignment of a drive letter. The Windows Credentials section is where login information is stored regardless of how the share was accessed or mapped.
  • Paul Stelian
    Paul Stelian almost 7 years
    @DavidPostill Maybe not but deleting them all actually allowed me to map another one.
  • Admin
    Admin almost 7 years
    for net use, if you enter * for the password, it will prompt you for it.
  • Lilienthal
    Lilienthal almost 7 years
    I got the same issue as Mark. I assume the link that GetFree provided is related but it's not fully correct as in my case I had connected via IP in the first place. It seems the GUI just screws up and as a workaround you can use the server name if you used the IP for the GUI or vice versa to get a new login or map prompt. These types of loging do not show up in the Credential Manager.
  • Damon
    Damon over 6 years
    The GUI behaves less dumb if you save the password in the password manager application (last thingie on the "user accounts" control panel page). This actually works, reliably, every time (whereas otherwise it seems to work 20% of the time, and fail again after reboot).
  • Diego Tercero
    Diego Tercero almost 6 years
    @voji, on your shell syntax and example you forgot to put a colon right after the /user option. Like this : net use s: \\homesrv\share /user:vp pass123
  • voji
    voji almost 6 years
    @DiegoTercero thank you for the info, i fixed the missing colon on my post.
  • Admin
    Admin over 5 years
    Aslo, the <driveletter>: is optional. Not everyone wan'ts to access the network like a floppy disk :)
  • peterh
    peterh about 4 years
    What is does? How does it work?
  • Admin
    Admin almost 4 years
    Combing this answer and the two previous comments, I was able to achieve my similar need -- connect to a network share using separate credentials without mapping to a drive letter. So the combination for my needs is: net use \\<server>\<sharename> /USER:<domain>\<username> * Note that with this set of parameters, you must either specify the password or use the asterisk to signify that you want to be prompted (which I do).
  • Jack_Hu
    Jack_Hu almost 4 years
    @MarkJeronimus - This is a little niche, but you can (in addition to the hostname and IP address) also use a FQDN (fully-qualified domain name) to reference the server/share. I use Ubuntu as my server, and I can append extra names to its loopback address in its host file, /etc/hosts. So it now looks something like: 127.0.1.1 myserver myserver-root. I can then map a network drive to say, M: as \\myserver, with an unprivileged user, and N: as \\myserver-root, with a fully privileged user. Windows will allow them, and it remains resilient to logical topology changes (IP changes).
  • Admin
    Admin over 2 years
    It helped me to do the "net use <network location> /delete" first and then try this.