How can i create a map drive with a username and password required when accessing the drive? i already have map drives and i already input a username and password in ( Connect as optional ) field. Help guy's pls.
2 Answers
From a command-prompt:
NET USE x: \\SERVER\Share /user:DOMAIN\username password
Where x:
is the drive letter, \\SERVER\Share
is the UNC to map the drive to, DOMAIN\Username
is the username to use, and password
is the password (do not include the password to force the user to enter the password).
Once the drive is "mapped" the user won't be prompted for the password again. There is no built-in method I'm aware of to cause the user to be prompted each time the drive is accessed. Your best bet would be to use a script to prompt the user.
Better still, just use NTFS permissions (ACLs) to limit access to the share and allow users to authenticate with their logged-on credentials.
![](../../users/profiles/7200.webp)
- 141,071
- 19
- 191
- 328
You can't map multiple drives with different users to the same machine.
(IPC$ connection is opened in the background to list shares, etc. You can workaround this but you are fighting the way it is supposed to work)
The most common cause of this is a misunderstanding of how to use AD. Don't use different users to represent permissions, use them to represent actual users. You can use security groups to represent a set of permissions.
![](../../users/profiles/15008.webp)
- 8,138
- 2
- 24
- 36