Re: Map Drive VPN
From: Erin0 (erin0_at_comcastremovethis.andthis.nottomentionthis.net)
Date: 10/26/04
- Next message: OverSeer: "Temporary Event Consumer (or Permanent)"
- Previous message: Rob: "The Active Directory property cannot be found in the cache"
- In reply to: stev379: "Map Drive VPN"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 26 Oct 2004 07:41:39 -0600
Welcome to my hell.
Without an error message it sounds like you might have a three fold problem.
1. The Cisco VPN Client's application launcher doesn't like VBS scripts
(unless you know something I don't, please say you do!!!).
2. We've noticed with the Concentrator that their is a lag between
actually connecting and being able to see resources on the network. It's
not long, just long enough to make a script fail.
3. %USERNAME% doesn't work in your script.
Ready for a hokey fix? Since the application launcher doesn't like vbs
files (and honestly I think it barely likes bat files based off of what I've
read), and since their is a slight lag, what we did was create a bat file
that calls a vbs script to wait until it sees the network to run a central
login script. I wanted central control of the login script so that when I
made a change I didn't have to worry about distributing the script to all of
my VPN users. Their are of course lots of other ways to do this, none of
them overly slick with the Cisco VPN client. Cisco has a great VPN product,
just a crappy client. True to Cisco form. Ultimately what we decided was
that this was too hokey and that the VPN user will just have to map their
own drives. I would love to know what you end up doing.
So here are the files:
**This is the bat file that the application launcher kicks off:
@echo off
wscript.exe "C:\Documents and Settings\All Users\Application
Data\CiscoVPN\VPNClntLogon.vbs"
** This is the VBS script that sits and waits until it sees the network, aka
VPNClntLogon.vbs. Please note, that it tries to find the network login
script for five minutes and then if it doesn't it stops. This keeps the
script from running indefinitely, which is a good thing.
On Error Resume Next
count = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Do Until
objFSO.FileExists("\\domain.com\sysvol\domain.com\scripts\VPNLogon.vbs") Or
Count = 60
WScript.Sleep 5000
count = count + 1
Loop
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "wscript \\domain.com\sysvol\domain.com\scripts\VPNLogon.vbs"
** This is the actual login script which does the mapping aka VPNLogin.vbs.
Note that it uses the users login name in the actual map command. This is
where your script was failing. %USERNAME% is great for batch files, not so
great for VBS.
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")
If fso.DriveExists ("H:") THEN
Else
WshNetwork.MapNetworkDrive "H:", "\\Server\Users$\" &
wshNetwork.UserName
End If
Hope that helps. Believe me you, I anxiously await to hear how you are
doing this. I despise this solution but can't come up with any other bright
ideas that don't end up copying files to the user.
"stev379" <stev379@discussions.microsoft.com> wrote in message
news:C0819500-5410-4235-A9B4-4A16210BEC6D@microsoft.com...
> We connect with a Cisco VPN as a backup to Citrix. We need to map drives
> once connected via the VPN. Problem is the users connect to a private
> directory \\Server\Private\?????.
> ????? = the user's name (ie bjangles). How can I get the script to map
> the
> user's private directory? The script below is failing as it can't find
> the
> network path.
> ------------------------------
> Option Explicit
>
> Dim ObjNetwork
>
> 'on Error Resume Next
> Set ObjNetwork = WScript.CreateObject("WScript.Network")
>
> objNetwork.MapNetworkDrive "s:" , "\\wifl01\private\_
> %USERNAME%"
> -----------------------------
>
> Any help or suggestions is appreciated.
> Thanks!
> -Steve
- Next message: OverSeer: "Temporary Event Consumer (or Permanent)"
- Previous message: Rob: "The Active Directory property cannot be found in the cache"
- In reply to: stev379: "Map Drive VPN"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|