Drive Mapping Script Not working
- From: "Matthew Loraditch" <mloradites AT Yahoo DOT Com>
- Date: Wed, 9 Nov 2005 10:02:02 -0500
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
.
- Prev by Date: Re: how to retrieve a property named "#cdata-section"
- Next by Date: Re: [MSH] Zip / tar / compress / uncompress functionality
- Previous by thread: RE: Collect log files
- Next by thread: Re: Drive Mapping Script Not working
- Index(es):
Relevant Pages
|
Loading