Windows Logon Scripts - Multiple MapNetworkDrive
Introduction to Map Network Drive - Multiple Drives
If a job is worth doing, then it's worth doing well. Once you have mastered the basic MapNetworkDrive method, you may wish to add more drive letter mapping to your Windows logon script. Here is how you map multiple drives to network shares.
Topics for MapNetworkDrive Multiple Drives
Perhaps in addition to a home folder, your users need to access a second shared folder on the server. The answer is one logon script which maps both shares. An alternative scenario is that you are building a script which maps drives depending on which group a user is a 'member of'. In this instance. you create a selection of mapped drives, but only one is actually implemented.
Our objective is to map two drives, M: and P: with a logon script. The corresponding shares are held on a Windows 2003 server. However, you could use any Microsoft machine later than Windows 95 to host the shared folders.
Pre-requisites for MapNetworkDrive
Instructions for multiple Mapped Network Drives
' TwoMap.vbs - Map Network Drive to M: and P:
SolarWinds' Config Generator is a free tool, which puts you in charge of controlling changes to network routers and other SNMP devices. Boost your network performance by activating network device features you've already paid for.
Guy says that for newbies the biggest benefit of this free tool is that it will provide the impetus for you to learn more about configuring the SNMP service with its 'Traps' and 'Communities'. Try Config Generator now - it's free!
Note 1: There are a surprising number of traps when mapping multiple drives. The central point is that each new drive letter has its own line.
Note 2: You could repeat the above line for each share you want to map, provided you change the strDriveLetter2 and strRemotePath2. Mistakes arise where people get too clever and try to map 6 drives all on one line.
Note 3: From a scripting point of view, just create one object. It is not necessary to Set objNetwork1, objNetwork2 for each drive, just recycle the one variable - objNetwork.
Note 4: Although I disapprove, it is possible to use share names with spaces, for example, "download reports".
If you have more than two multiple drives then just copy, paste and then amend these lines:
strRemotePath2 = "\\alan\downloads reports"
Declare strDriveLetter3, 4, 5, just paste in extra commands to match.
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
The modern group policy method of drive mapping does not require any scripting. In Windows Server 2008 you can launch the Group Policy Management Console and configure Drive Maps by clicking with a mouse. See more on Windows 8 Group Policy Drive Maps.
There may be situations where you need not one, but many mapped network drives. As with many scripting jobs, there is a knack of getting the correct logic and syntax. My advice is build your Windows VBScript gradually, master the basic logon script before attempting this more difficult example of multiple map network drives.
If you like this page then please share it with your friends
See more logon scripts examples