Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


June 2003

The Magic of Drive Mapping

Give users fast, easy access to network resources
RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
SideBar    Using Mapped Files for Backups

Download the Code Here

With this capability, you can share a drive, then map any or all of the folders on that drive. However, you need to be exceptionally judicious about security in such cases. I use this technique only in test lab scenarios that provide a controlled environment (i.e., a discrete LAN on a hub that's unconnected to the rest of the enterprise and on which I either run a firewall or eliminate Internet access). After I share drive C of each computer that's on the LAN, I can remotely access any folder on those drives. For example, to access the LabData folder on the C drive of the TestBox server in my lab, I can type

net use d: \\TestBox\C\LabData

I can then perform any task that involves a remote folder. For example, I use mapped drives to perform backups across the network; for details, see the sidebar "Using Mapped Files for Backups."

Administrators can use the Net Use command within logon batch files to set mapped drives for users so that they can easily access frequently used folders on remote systems. For example, for users who work with the company database, you might have a logon script that contains the following lines:

net use g: \\BigServer\OurDatabase
net use h: \\BigServer\DatabaseFiles

Name the batch file whatever you want (be sure it has a .bat extension), and copy it to the logon script directory on your domain controller (DC). The default location for logon scripts on a Win2K DC is %SystemRoot%\SYSVOL\sysvol\domain name.com\scripts. Win2K automatically shares the scripts subfolder with the share name Netlogon.

Be very careful not to map the drive letter assigned to user home drives. During user logon, Windows maps the home drive before running logon scripts from the scripts subfolder. If your logon script tries to map a drive letter that's already used, the system returns the message The local device name is already in use.

Automatic Disconnection of Mapped Drives
Sometimes, when a user opens My Computer or Windows Explorer, a red X appears on the mapped drive's icon, indicating that the drive isn't available. Windows automatically disconnects mapped drives after a period of inactivity (the default interval is 15 minutes) and displays a red X on the drive's icon. When that happens, clicking the icon or entering the drive letter followed by a colon (:) at the command prompt automatically reconnects the drive. But the red X also appears if the computer that holds the mapped share isn't available for some reason, in which case these steps don't work. Because users can't tell why the red X appears, they often call the Help desk.

You could cut down on those Help desk calls if you could disable the automatic disconnection of mapped drives so that users see a red X only when a remote computer is down. The Autodisconnect registry value controls the automatic disconnect. According to Microsoft, you can disable this function by setting Autodisconnect to -1. However, the registry won't let you enter a minus sign for this value. Some Microsoft support technicians suggest entering

net config server /autodisconnect:-1

at a command prompt. Although this command appears to enter a value of -1 for the Autodisconnect registry value, it actually changes the value to the maximum supported value, which is 4,294,967,295 minutes (more than 8000 years) for Win2K Professional and 65,535 minutes (more than 45 days) for Win2K Server. Both values are large enough to effectively disable the autodisconnect function. However, the Net Config command also changes two other subkey values, and these additional changes (which affect browser announcement schedules) might cause other problems.

Some administrators try changing the Autodisconnect value to 0. However, a 0 value doesn't prevent automatic disconnection of mapped drives. Rather, this value has the effect of disconnecting drives erratically and often quite quickly.

The best approach is to explicitly set Autodisconnect to the maximum supported value. Start a registry editor (e.g., regedit.exe) on the computer that holds the share (not the remote computer that maps the share). Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters subkey, and double-click the Autodisconnect registry value. If the computer on which the share resides is a Win2K Pro workstation, enter a new decimal value of 4294967295 or a new hexadecimal value of ffffffff. If the computer is a Win2K server, enter a new decimal value of 65535 or a hex value of 0xffff.

   Previous  1  2  [3]  4  Next 


Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...


Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Managing IT Across Multiple Locations

7 Ways To Get More From Your SharePoint Deployment Now

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement