Domain Logon Script Map Network Drive
You can add additional mapped drives by adding more if then statements.
Domain logon script map network drive. Windows server 2019 basic video tutorials by msftwebcast in this step by step video guide i will show you how to map network drives using bat file login scr. Drive to the server shared finance share. At the point of logon the script above takes a look through all the groups in which the user is a member.
Good evening i have recently been trying to get a bit more familiar with windows server 2012 r2 we had covered windows server a. To map a network drive using t as the drive letter and without username password protected use the following guide. S 10 10 10 1 share dim network.
Connect to a command prompt by clicking on start and search for cmd. Then if i travel to location 2 the a drive would be gone and i only see drive b. I use scripts to map network drives but now since we added another location i m looking into mapping drives based on the domain site location.
However if you are introducing a login script you should disconnect any existing network drive mappings first so that your script can work. Tomalak s answer worked great for me 1. If that user is in the finance group then the script will map the r.
Driveexists false dim i for i 0. I only needed to make alter it slightly for my purposes and i didn t need a password it s for corporate domain. This disconnects any drive mapping created on the letter s.
To remove a mapping for all users add the following code to the top of your logon script where g is the drive letter to remove. Delete y installing and setting a user s default printer. For example if i m in location 1 i would have the a drive.