Drive Mapping Script Not working



I have a script that maps drives based on a machines name here is a sample
portion
On Error Resume Next
Err.Clear
Set oWshNet = CreateObject("Wscript.Network")
strComputer = UCase(oWshNet.computerName)
Select Case Left(strComputer, 4)
Case "BR01", "BASE"
oWshNet.RemoveNetworkDrive "S:"
oWshNet.RemoveNetworkDrive "W:"
oWshNet.RemoveNetworkDrive "G:"
oWshNet.RemoveNetworkDrive "Z:"
oWshNet.MapNetworkDrive "S:", "\\BLOCALSERVER\branchshare"
oWshNet.MapNetworkDrive "W:", "\\MAINSERVER\bankshare"
oWshNet.MapNetworkDrive "G:", "\\BLOCALSERVER\apps"
oWshNet.MapNetworkDrive "Z:", "\\BLOCALSERVER\zeus"
Case "BR02", "DUND"
oWshNet.RemoveNetworkDrive "S:"
oWshNet.RemoveNetworkDrive "W:"
oWshNet.RemoveNetworkDrive "G:"
oWshNet.RemoveNetworkDrive "Z:"
oWshNet.MapNetworkDrive "S:", "\\BLOCALSERVER\branchshare"
oWshNet.MapNetworkDrive "W:", "\\MAINSERVER\bankshare"
oWshNet.MapNetworkDrive "G:", "\\BLOCALSERVER\apps"
oWshNet.MapNetworkDrive "Z:", "\\BLOCALSERVER\zeus"
........REST OF OFFICES ....
Case Else
oWshNet.RemoveNetworkDrive "S:"
oWshNet.RemoveNetworkDrive "W:"
oWshNet.RemoveNetworkDrive "G:"
oWshNet.RemoveNetworkDrive "Z:"
oWshNet.RemoveNetworkDrive "J:"
oWshNet.RemoveNetworkDrive "F:"
oWshNet.MapNetworkDrive "S:", "\\MAINSERVER\branchshare"
oWshNet.MapNetworkDrive "W:", "\\MAINSERVER\bankshare"
oWshNet.MapNetworkDrive "F:", "\\MAINSERVER\apps"
oWshNet.MapNetworkDrive "Z:", "\\MAINSERVER\zeus"
oWshNet.MapNetworkDrive "J:", "\\MAINSERVER2\data"
oWshNet.MapNetworkDrive "G:", "\\MAINSERVER\apps1"
End Select

The script goes on through the rest of the offices and then ends up on an
else case which we use for our main office. This script is not applied via
group policy but via the login script attribute on each individual user. We
just this weekend migrated to a new data warehousing provider and new frame
relay network with a new set of ip addresses for all of our equipment. For
the next month we are running on both networks with the new 10.55.x.x
network as primary on all machines and our old 10.3.x.x and 10.4.x.x network
as secondary with persistent routes on machines to allow for the access to
the old resources to which we still have available for a short time. The
script is supposed to work by detecting the name of the current computer
matching it to a case and then mapping drives accordingly. We have one share
on our main server that all offices access \\MAINSERVER\Bankshare and each
branch has local shares at their office. \\LOCALSERVER\sharename Since the
switchover this weekend some machines have been successfully mapping 3 of
the 4 shares, S:, W:, and Z: are consistently working however the G: Drive
will show up as disconnected and then when double clicked instead of going
to the local server it will open up the G: drive from our main server (Our
main office uses the MAIN server for G:, S:, W: and Z:) at
\\MAINSERVER\APPS1 instead of \\LOCALSERVER\APPS once rebooted the drive
will map correctly but only for the first person to logon to the machine if
a user logs off and then another logs on the G: drive will be disconnected
again. I am unable to disconnect the share using either net use or the gui
functions as windows reports it is not in use, however if i try to to do a
net use and map the share correctly net use reports the share to already be
in use.
This has been extremely odd and frustrating and any help would appreciated
in trying to resolve the issue
Thanks
Matthew Loraditch - BCSB


.



Relevant Pages

  • Re: troubleshoot a script
    ... I see you use the memberOf attribute. ... ' map appropriate drives. ... The part of the script that will not work for the 3 ...
    (microsoft.public.scripting.vbscript)
  • Unable to remove remembered drives
    ... The script is completely finished and works perfectly if I ... It turned out that it couldn't map the drive for some ... appears I cant remove these remembered drives, ... Set fso = Createobject ...
    (microsoft.public.scripting.vbscript)
  • Re: User Independent Mapped Drive
    ... OU that runs a batch file to map the drives. ... server of where they're from. ... script, ...
    (microsoft.public.windows.server.networking)
  • RE: Local user corruption
    ... Can you use a batch file to map the drives as the domain logon script? ... You can use "net use" to map a network drive. ...
    (microsoft.public.windows.server.migration)
  • Re: Issues mapping network drive via login script
    ... the scripts if they dont all connect cause they dont "understand" how to map ... The computer that is not mapping the drives - does it have any of those ... CD/DVDROMs in Disk Management so that my script could actually map the drive ... I have login scripts assigned to the domain users via the Profile ...
    (microsoft.public.windowsxp.general)

Loading