Have Remote Drive Prompt Again for Password
What sort of environment are you lot using? Are you using Agile Directory? If then, and so just use security groups from active directory to apply permissions to folders / shares and and so map the shares they need using a logon script. They volition exist denied access to any other folders they are not allowed access to.
I don't recollect there would exist any sensible mode of automating this and it is a very bad idea to include passwords in obviously text files. If you lot wanted to prompt for a password every time the script runs, use this: Internet USE * \\<Your server>\<Your Share> /USER:<username>
This is exactly the sort of thing Advert was designed for.
If you are working in a smaller company with a small amount of users, but map the drives manually and specify alternate logon credentials during the procedure.
Alfie
thumb_up thumb_down
Hello,
Assuming you are using the "net employ" command:
Batchfile
The syntax of this command is: NET Use [devicename | *] [\\computername\sharename[\volume] [password | *]] [/USER:[domainname\]username] [/USER:[dotted domain name\]username] [/USER:[username@dotted domain proper noun] [/SMARTCARD] [/SAVECRED] [[/DELETE] | [/PERSISTENT:{Yep | NO}]] Internet USE {devicename | *} [password | *] /HOME Net USE [/PERSISTENT:{YES | NO}]
Therefore the control would look something like this:
Batchfile
net employ * \\Server\Folder /Persistent:yes /user:username Pa$$W0rd
But every bit it was said information technology would mean storing the password in the patently text batch file, you could withal encrypt the batch file:
http://smallbusiness.chron.com/encrypt-batch-file-39813.html
thumb_up thumb_down
Cheers for prompt respond Alfie...
No ad on this network. This is a file sever using win 7 and the user'southward connect only to back up their work and to dl new md templates equally required.
thumb_up thumb_down
Hi Shaun,
How many people practise y'all have working at the company? If information technology is a pocket-sized corporeality of people, it might be easier to map the drives manually.
Does everyone connect using a different account?
Alfie
thumb_up thumb_down
Hi Alfie
it is not such a small visitor but also multiple locations. My biggest problem is that I take to do it remotely and the users on the other side are not really pc literate. This makes information technology harder to work with.
Ideally, I would like to send the supervisor a batch file that when they run information technology maps the drives but asks them for their username and pw... either in the cmd line or once they attempt to connect to their folders, I seem to retrieve something like this from way back just can't remember what.
Shaun
thumb_up thumb_down
This is what I am using to map the drive but it does not ask for a pw afterward mapped
cyberspace use X: \\10.0.0.200\Staff
thumb_up thumb_down
So each fellow member of staff has a different business relationship. is the account name the same as the business relationship name they are logged on to their machines with? You tin can check this by running echo %username% in cmd on a staff members motorcar.
If the account names are the aforementioned, you can run:
Batchfile
NET USE Ten: \\<Your server>\<Your Share> /USER:%username%
Also, to remove any credentials that take been saved previously, remove them using Credential Manager in Control Panel.
Alfie
thumb_up thumb_down
This is what I am using to map the drive but it does not ask for a pw after mapped
net utilize X: \\10.0.0.200\Staff
Why drop that command into a batch file and place it in :-
C:\ProgramData\Microsoft\Windows\First Menu\Programs\Startup
So when they log on it will map information technology your Ten drive. Y'all tin do this all to remote PCs , saving you time for beer and bacon.
thumb_up thumb_down
always up for Beer! but if you do that it still will non inquire them for a pw which means user1 can admission user2 files.
Alfie, yours would be perfect but they do not use their ain names for pc's. How would they then add together their pw?
thumb_up thumb_down
The fashion I am doing it now is:
- remote into their pc
- type ten.0.0.200 in the run command
- when it logs into the file server it asks for username and pw
- right click on the Study folder and select Map Network Bulldoze
I am merely looking for a way to brand this simpler so I can transport ane bat file out to the managers who tin can insert thumb bulldoze and run bat file. When information technology runs it asks for a username and pw and, if correct, creates the mapped bulldoze.
DONE!
thumb_up thumb_down
If the usernames they connect with are different to the ones they are logged on with, and then y'all need to specify the username like this:
Batchfile
NET USE X: \\<Your server>\<Your Share> /USER:<username>
This would evidently mean that you would need a different batch file for each user, which is a pain.
If y'all could change the usernames on the file server to match the usernames the users logon with, then you will save a whole load of time and hassle. Then, yous could use the %username% environment variable in your scripts and use one script for everyone.
If you tin can't alter the usernames to friction match, I would as well deny them access with their electric current user accounts to that share, so that they don't map the drives manually and proceeds admission to everything.
Alfie
thumb_up thumb_down
Shaun9600 wrote:
The mode I am doing information technology now is:
- remote into their pc
- type 10.0.0.200 in the run command
- when it logs into the file server it asks for username and pw
- right click on the Study folder and select Map Network Drive
I am just looking for a way to make this simpler and so I can send 1 bat file out to the managers who can insert thumb drive and run bat file. When it runs it asks for a username and pw and, if correct, creates the mapped bulldoze.
Washed!
Then just your original:
Batchfile
net use X: \\ten.0.0.200\Staff
But clear any cached credentials using the Credential Director in Windows Control Panel. When you run this command, It volition try and authenticate using the current user account or buried credentials only if none of them work, it should prompt for a username and countersign.
thumb_up thumb_down
This sounds like a winner will try ASAP and let you know... they are currently Unavailable
thumb_up thumb_down
If you employ the asterisk wildcard after the username it volition prompt the user for a password.
Batchfile
net use X: \\<Server>\<Folder> /user:<username> *
This coupled with the set command should become you an easy batch file to deploy:
Batchfile
#PlaceHolder Echo off echo . gear up /p myusername = "Delight Enter Username:" echo . Net use * \\<Server>\<Folder> /user:<Domain>\%myusername% * echo . pause
I take added the line "#PlaceHolder" due to a strange problem where the batch file would read the showtime line as below:
Batchfile
C: \Users\aron\Desktop >´╗┐#PlaceHolder
The (´╗┐) was non in my text only keeps getting added to the output and then had to make a dummy first line therefore I wrote #PlaceHolder
Other than that this script will enquire for the username and then prompt for the password. I have tested this on windows 7 64bit Bone and it worked fine.
thumb_up thumb_down
I accept 1 powershell script to map network ,alter shareaddress,username and password ,This script will mount to Z: drive.
Powershell
If (!( Test-Path Z : )) { $shareadress = "\\10.0.0.2\exam" $username = "sp\test" $pwd = "laissez passer$123ff" $password = ConvertTo-SecureString -AsPlainText -Forcefulness -Cord $pwd $credentials = New-Object -TypeName Arrangement . Management . Automation . PSCredential -ArgumentList $username , $password endeavour { New-PSDrive – Proper noun "Z" – PSProvider FileSystem – Root $shareadress -Credential $credentials – Persist -ErrorAction Stop } catch { $_ | Out-File d : \ temp \ mountain . log } }
thumb_up thumb_down
Create a batch file that maps the drive as follows:
net utilize X: \\10.0.0.200\Staff /user: // this will prompt for a username and password
Copy the file to each PC in the a directory called UTILS for example.
Then create a shortcut on each users desktop that they tin execute when necessary the points to the batch file in C:\UTILS.
BTW you lot can you the /PERSISTENT:YES switch with NET Utilise to make the drive permanent
Also the SAVECRED to store the provided credentials for reuse.
thumb_up thumb_down
Source: https://community.spiceworks.com/topic/1798503-create-a-bat-file-for-mapped-drive-with-password
0 Response to "Have Remote Drive Prompt Again for Password"
Post a Comment