Accessing a Windows share with a different username

55

23

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.

Kieth Parker

Posted 2014-03-12T10:36:29.360

Reputation: 553

Answers

41

You can specify it through the command line using the net command.

net use <driveletter>: \\<server>\<sharename> /USER:<domain>\<username> <password> /PERSISTENT:YES

You can also specify different credentials using the Windows Explorer GUI. From the Tools menu select Map network drive.... On the Map Network Drive dialog window there is a checkbox for "Connect using different credentials".

Note: If you do not see the menu bar in Windows Explorer, press the ALT key to make it appear.

user87883

Posted 2014-03-12T10:36:29.360

Reputation:

1for net use, if you enter * for the password, it will prompt you for it. – localhost – 2017-07-28T04:49:35.900

Aslo, the <driveletter>: is optional. Not everyone wan'ts to access the network like a floppy disk :) – Robert Jørgensgaard Engdahl – 2018-11-27T09:58:56.803

21

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

voji

Posted 2014-03-12T10:36:29.360

Reputation: 376

18The 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." – Mark Jeronimus – 2016-02-14T10:12:09.730

3

@MarkJeronimus, look here https://support.microsoft.com/en-us/kb/938120 TL;DR: You have to use the computer's IP, not it's network name.

– GetFree – 2016-11-29T16:14:18.430

@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. – Daniel Saner – 2017-03-07T02:27:00.903

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. – Lilienthal – 2017-08-11T15:06:17.817

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). – Damon – 2017-11-12T11:46:39.323

1@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 – Diego Tercero – 2018-06-18T09:01:55.103

@DiegoTercero thank you for the info, i fixed the missing colon on my post. – voji – 2018-06-19T11:53:04.060

11

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

Andrew Corkran

Posted 2014-03-12T10:36:29.360

Reputation: 127

2Welcome 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. – DavidPostill – 2016-03-10T18:01:22.190

3@DavidPostill Maybe not but deleting them all actually allowed me to map another one. – Paul Stelian – 2017-06-07T16:38:17.157