Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Directory Drive Map

Status
Not open for further replies.

jbotz

MIS
Jun 23, 2003
141
0
0
US
Hello, gurus. I am currently running a Windows 2000 Terminal Server with some fairly restrictive group policies in place (i.e.: no desktop, auto-run some software, hide the start menu groups, etc.). My problem is that we run some software that requires a connection to a mapped drive located on another server. I currently have a login batch file which calls a net use command to map the drive to the appropriate drive letter, but after a user has been connected once, they get a "Disk or Network Error" when trying to launch their program, which indicates that the mapped drive is not available. Is there some better way that I can map this drive out so it will not time-out and disconnect?
 
First try to map the drive manually to rule out that you have a permissions problem.

or run the bat file manually...just to make sure the user can connect. This is a good test before you go too crazy sorting out a script problem.

Also, in your script you should make sure that you always try to delete the mapped drive before you map it. For example, if you are trying to map something to the J: drive, your first command should be to delete the J: mapping. And then map J:. This is because the user may have a static manaul mapping using J: (not too likely I guess in a terminal session..but still good practice)


Yes, you can use a VB script to map the drive as an alternative...

Set oNetwork = CreateObject("wScript.Network")
oNetwork.MapNetworkDrive "H:", "//London/LabShare"



Joseph L. Poandl
MCSE 2003

If your company is in need of experts to examine technical problems/solutions, please check out (Sales@njcomputernetworks.com)
 
The script runs fine as far as that is concerned. Just out of curiosity, what is the command to delete a drive map?
 
There is an AutoDisconnect feature in Win2k and above. You will want to turn that off at the destination server and the Terminal Server. Set the value to 0xffffffff to disable autodisconnect.

System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServerParameters]
Value Name: Autodisconnect
Data Type: REG_DWORD (DWORD Value)
Value Data: 0 to 4,294,967,295 (0xffffffff) in minutes

For your drive mappings:

[script]
Set WSHNetwork = CreateObject("WScript.Network")
WSHNetwork.RemoveNetworkDrive "F:"
WSHNetwork.MapNetworkDrive "F:", "\\server\users",True
[/script]

If you need to set a local TS login script (sounds like you already have it running though) then take a look at

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top