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!

Red X's on mapped drives - need help 1

Status
Not open for further replies.

mucous

Technical User
Nov 28, 2002
164
0
0
US
Hi,

We're on a Win2k network both servers and clients(Win2k Pro). I've got a couple users that have some folders mapped from the server to their machine and all used to be well, however in the past couple months, When they go into My Computer, the mapped drives are showing with those pesky red X's. Of course, when they click on them, eventually the drive reconnects and they get into the folders, but it's beginning to get aggravating. I read about using the net config server command to turn off the autodisconnect function and gave it a try, but we're still getting the red X's. Is there any way to resolve this problem without having to resort to logon scripts? The scripts are wonderful, but the office is small and my users map and disconnect from drives on their own and I'd like to avoid having to "hard wire" their mappings.

As always, thanks for the great advice and tips!
 

You could setup a batch file in their startup group to map the drives. Might as well use a logon script.
 


Is there anything else that can be done without the use of logon scripts? I disabled the auto disconnect feature using net serve, but the trouble problem is still there. Funny, this only happens with the laptop users, not on desktops. I was thinking it may be the port replicators they connect with, but found it still happens plugging into the built in NICs on the laptops.
 
I have had the same thing happen on both Win2K Pro and XP Pro workstations. We use login scripts and have gone as far as to use the scripts to disconnect the drives and reconnect them at login. Still on a random basis the red x is showing up. We too have turned off the autodisconnect on the workstations and the servers. Our workstations are both dell towers and small form factors. We would also appreciate any help with this one.
 
Yeah, a logon script - thats about it. We've pretty much just lived with it a few years.. no big deal.. just a red X
 
I had the same problem and was able to finally get rid of the problem by using the login script below.

'==========================================================================
'
' NAME: LogonScript.vbs
'
' AUTHOR: Jay Jil
' DATE : 4/27/2004
'
' COMMENT: Enumerates current users' group memberships in given domain.
'
'==========================================================================


ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "mansfieldbankonline.com"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

WSHNetwork.RemoveNetworkDrive "E:",true,true
WSHNetwork.RemoveNetworkDrive "G:",true,true
WSHNetwork.RemoveNetworkDrive "H:",true,true
WSHNetwork.RemoveNetworkDrive "J:",true,true
WSHNetwork.RemoveNetworkDrive "L:",true,true
WSHNetwork.RemoveNetworkDrive "O:",true,true
WSHNetwork.RemoveNetworkDrive "R:",true,true
WSHNetwork.RemoveNetworkDrive "S:",true,true
WSHNetwork.RemoveNetworkDrive "T:",true,true
WSHNetwork.RemoveNetworkDrive "Z:",true,true

wscript.sleep 500

'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
'WScript.Echo GroupObj.Name
Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "Group1"
WSHNetwork.MapNetworkDrive "G:", "\\server1\share1"
WSHNetwork.MapNetworkDrive "H:", "\\server1\share2"
WSHNetwork.MapNetworkDrive "S:", "\\server1\share3"
WSHNetwork.MapNetworkDrive "O:", "\\server1\share4"
Case "Group2"
WSHNetwork.MapNetworkDrive "G:", "\\server2\share1"
WSHNetwork.MapNetworkDrive "H:", "\\server2\share2"
WSHNetwork.MapNetworkDrive "O:", "\\server2\share4"
WSHNetwork.MapNetworkDrive "S:", "\\server2\share3"
Case "Group3"
WSHNetwork.MapNetworkDrive "R:", "\\server1\share5"
Case "Group4"
WSHNetwork.MapNetworkDrive "T:", "\\server3\share6"
Case "Group5"
WSHNetwork.MapNetworkDrive "L:", "\\server4\share7"
Case "Group6"
WSHNetwork.MapNetworkDrive "Z:", "\\server1\share8"
End Select
Next


set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing

wscript.quit
 


I found the solution to my Mapped drives showing red X's. This was only happening to the Laptop users in my office becuse they have multiple NIC cards installed. There's the docking station NIC, the built in NIC, a wireless NIC, and also a SoncicWall Virtual NIC. They all had NetBeui selected. When I disabled NetBeui on all NICs except the docking station NIC the red X problem vanished. Everyone working from their dockinstations now connects to their mapped drives without any trouble. I now have another problem stemming from this. Any laptop user that now goes home or works from another location and connects to the VPN now cannot access those same mapped drives. The only thing I can think to do is enable NetBeui on both the docking station adapetrs AND the SonicWall VPN adapters, then disable the VPN adapter until needed. It's ok for me, but I'm afraid my users will not like this solution because they will have to remember all of this and it's created another step for them to go through to establish the VPN connection. Does anyone else out there have experience with SonicWall VPNs and have any ideas on making this easier? I'm also contacting them to see what they have to say, butmit's a hit or miss thing getting a tech there that knows what he's talking about, but here, the advice and suggestions are usually very good and on target.

Thanks
 
rijay: thanks for that script... looks good... I had a question... will this script really look at the membership of a user in a group and do the appropriate drive mapping based on that value?

Is this group name case sensitive?

Where would I put this .vbs file in order to get that to run for each user? (is it in active directory users and computers?)

The section at the end where you have a bunch of do nothings... what is that intended for?

Thanks.
Tony


 
Tony,

If you are worried about the case sensitivity of the group names you could change the script like this:
Code:
Select Case lcase(GroupObj.Name)
'Check for group memberships and take needed action
    Case "group1"
That way you can list all the group names in lower case no matter how they are entered in AD.

You would put this file in a GPO as a login script. Right click your domain in AD Users and Computers. Choose properties. Click the GPO tab. Select a GPO and hit edit or create a new on. Under User Configuration, Windows Settings, Scripts, Login.

The code at the bottom of the screen is simply clearing the memory used by those variables and is good scripting practice.


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

Regards,

Mark
 
I always like to see different ways of scripting...heres a star
 
Here is my novell login script... do you think your script above can be tweaked to map drives like I do on novell as shown below?

Basically I am trying to mimic my login script that runs on novell which is driven off group membership on NT 2003 which I am migrating to later in the month...

rem IF MEMBER OF "HR" THEN BEGIN
rem WRITE "Attaching user %FULL_NAME to Human Resources Dedicated Server,"
rem ATTACH PGCHICAGO3/%LOGIN_NAME
rem MAP H:=PGCHICAGO3\SYS:
rem MAP ROOT L:=PGCHICAGO1\HR:
rem MAP ROOT I:=PGCHICAGO3\SYS:\USERS\HR\%1
REM END

REM *** MAP DRIVE "I" AND MAPPING FOR QUATTRO RESOURCE AND MENU
REM *** FILES FOR ALL USERS ON THE NETWORK

IF MEMBER OF "ACCT" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\ACCT\%1
MAP S1:=PGCHICAGO1\PG1:USERS\ACCT\%1
END

IF MEMBER OF "ACCTMGR" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\ACCTMGR\%1
MAP S1:=PGCHICAGO1\PG1:USERS\ACCTMGR\%1
END

IF MEMBER OF "ADM" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\ADM\%1
MAP S1:=PGCHICAGO1\PG1:USERS\ADM\%1
END

IF MEMBER OF "BOOKKEEP" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\BOOKKEEP\%1
MAP S1:=PGCHICAGO1\PG1:USERS\BOOKKEEP\%1
END

IF MEMBER OF "CAPFUND" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\CAPFUND\%1
MAP S1:=PGCHICAGO1\PG1:USERS\CAPFUND\%1
END

IF MEMBER OF "RECEPTION" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\RECEPTION\%1
MAP S1:=PGCHICAGO1\PG1:USERS\RECEPTION\%1
END

IF MEMBER OF "CONTROL" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\CONTROL\%1
MAP S1:=PGCHICAGO1\PG1:USERS\CONTROL\%1
END

IF MEMBER OF "EXEC" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\EXEC\%1
MAP S1:=PGCHICAGO1\PG1:USERS\EXEC\%1
END

IF MEMBER OF "HUNTLEY" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\HUNTLEY\%1
MAP S1:=PGCHICAGO1\PG1:USERS\HUNTLEY\%1
END

IF MEMBER OF "HORIZON" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\HORIZON\%1
MAP S1:=PGCHICAGO1\PG1:USERS\HORIZON\%1
END

IF MEMBER OF "OUTDOOR" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\OUTDOOR\%1
MAP S1:=PGCHICAGO1\PG1:USERS\OUTDOOR\%1
END

IF MEMBER OF "HR" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\HR\%1
MAP S1:=PGCHICAGO1\PG1:USERS\HR\%1
END

IF MEMBER OF "INFOSYS" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\INFOSYS\%1
REM MAP S1:=PGCHICAGO1\PG1:USERS\INFOSYS\%1
MAP K:=PGCHICAGO1\FAX:
MAP L:=PGCHICAGO1\DIST:
END

IF MEMBER OF "LEGAL" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\LEGAL\%1
MAP S1:=PGCHICAGO1\PG1:USERS\LEGAL\%1
END

IF MEMBER OF "SECRETARY" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\SEC\%1
REM MAP S1:=PGCHICAGO1\PG1:USERS\SEC\%1
END

IF MEMBER OF "EXCHANGE" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\EXCHANGE\%1
MAP S1:=PGCHICAGO1\PG1:USERS\EXCHANGE\%1
END
 
Here is what I use. This can be used to map drives and/or printers based on group membership.

Code:
'==========================================================================
'
' NAME: LogonScript
'
' AUTHOR:  Mark D. MacLachlan, The Spider's Parlor
' URL   : [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 4/10/2003
'
' COMMENT: Enumerates current users' group memberships in given domain.
'
'==========================================================================


ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "DomainName"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

'Synchronizes the time with Server our NTP Server
WSHShell.Run "NET TIME \\Server /set /y"


WSHNetwork.RemoveNetworkDrive "F:"

wscript.sleep 300

'Maps drives needed by all
WSHNetwork.MapNetworkDrive "U:", "\\server\users",True
WSHNetwork.MapNetworkDrive "X:", "\\server\executables",True

'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups

Select Case GroupObj.Name
'Check for group memberships and take needed action
	Case "Admin"
		WSHNetwork.MapNetworkDrive "w:", "\\Server\Admin Stuff",True
	Case "WorkerB"
		WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True

End Select

Next


'Install Printers

WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"



set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing

wscript.quit

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

Regards,

Mark
 
How much would you charge to change my novell script into a WSH script?

I simply don't have time... ;) or the scripting experise.
I can paypal you $. I don't think it would take long.

I would like to have you write it and then I'll try it on the domain. I'd like to setup variables such that in the beginning it asks me:

secdirectory = c:\users\sec
and then you use this secdirectory variable thru the rest of the script... that way I can change or modify as need be...

thoughts?
 
Tadduci, no payment is needed. Helping is what these forums are about.

Here is what you need to do, it is actually very simple.

Convert your script like this.

Where you have:
IF MEMBER OF "ACCT" THEN BEGIN
MAP ROOT I:=PGCHICAGO1\PG1:USERS\ACCT\%1
MAP S1:=PGCHICAGO1\PG1:USERS\ACCT\%1
END


You would simple convert this for use in my script like this (provided I am deciphering the UNC path right, it has been nearly ten years since I dealt with Novell):
Case "ACCT"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1\USERS\ACCT",True


Win2K doesn't have search drives like Novell so that line would not get used.

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

Regards,

Mark
 
We also had the problem. But after a little time we were able to access the drives. We set the autoidle time from lanman to "ffffff" and the problem was solved.It disconnect idle networkdrives after 15 Minutes automatic and reconnects them after trying to access. Here is the exact registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters

Set the key "autodisconnect" to ffff


best regards
 
We also had the problem. But after a little time we were able to access the drives. We set the autoidle time from lanman to "ffff" and the problem was solved.It disconnect idle networkdrives after 15 Minutes automatic and reconnects them after trying to access. Here is the exact registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters

Set the key "autodisconnect" to ffff


best regards
 
markdmac: thanks... let me try and write this and post here to get your approval...

thanks
tony
 
How does this look...

So when the user logs in, this script gets run, it clears any mapped drives that already exist, then it looks up in AD what user group he/she is in runs the map drive command and then installs a printer for them?

q1. what happens if a printer already exists for that user that is already installed
q2. what happens if no drivers exist on the workstation for that printer, does it prompt to install them or download them from the server already if they are provided...


'==========================================================================
'
' NAME: LogonScript.vbs
'
' AUTHOR: Jay Jil, modified: Tony Adduci
' DATE : 4/27/2004
'
' COMMENT: Enumerates current users' group memberships in given domain.
'
'==========================================================================


ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "mansfieldbankonline.com"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

WSHNetwork.RemoveNetworkDrive "I:",true,true
WSHNetwork.RemoveNetworkDrive "J:",true,true
WSHNetwork.RemoveNetworkDrive "K:",true,true
WSHNetwork.RemoveNetworkDrive "L:",true,true
WSHNetwork.RemoveNetworkDrive "N:",true,true
WSHNetwork.RemoveNetworkDrive "O:",true,true
WSHNetwork.RemoveNetworkDrive "P:",true,true
WSHNetwork.RemoveNetworkDrive "Q:",true,true
WSHNetwork.RemoveNetworkDrive "R:",true,true
WSHNetwork.RemoveNetworkDrive "S:",true,true

wscript.sleep 500

'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
'WScript.Echo GroupObj.Name
Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "ACCT"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1\USERS\ACCT",True
Case "ACCTMGR"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO1\PG1:USERS\ADM",True
Case "ADM"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1\USERS\ACCT",True
Case "BOOKKEEP"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\BOOKKEEP",True
Case "RECEPTION"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\RECEPTION",True
Case "EXEC"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\EXEC",True
Case "HORIZION"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\HORIZON",True
Case "HR"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\HR",True
Case "INFOSYS"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\INFOSYS",True
Case "LEGAL"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\LEGAL",True
Case "SECRETARY"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\SEC",True
Case "EXCHANGE"
WSHNetwork.MapNetworkDrive "I:", "\\PGCHICAGO\PG1:USERS\EXCHANGE",True

End Select
Next

'Install Printers

WSHNetwork.AddWindowsPrinterConnection "\\PGCHICAGO\HP5si"



set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing

wscript.quit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top