Accessing a Windows share with a different username
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Mysterious Puzzle
--
Chapters
00:00 Accessing A Windows Share With A Different Username
00:22 Accepted Answer Score 89
00:54 Answer 2 Score 42
01:32 Answer 3 Score 24
01:53 Answer 4 Score 8
02:23 Thank you
--
Full question
https://superuser.com/questions/727944/a...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windows7 #networkshares #smb
#avk47
ACCEPTED ANSWER
Score 89
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.
ANSWER 2
Score 42
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:
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
Important: Windows stores this account in the Windows credentials. In order to change the username for the connection the outdated Windows credential needs to be removed first. Otherwise you can connect, but will get an error on reconnect as it still uses the old credentials when reconnecting.
ANSWER 3
Score 24
To delete saved share usernames:
open cmd prompt type:
net use \\fileservername /del
ornet use * /del
to delete all
ANSWER 4
Score 8
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