login script after setting up vpn connection

login script after setting up vpn connection

Post by kris hoube » Tue, 09 Aug 2005 17:29:29


Hello,

we have setup vpn access towards our 2003 server
i want to run a login script after users make a connection to the 2003
server over vpn from their home computers.
this script should map the p: drive to their personal folder (which is under
the shared map personalfolder\loginname)

I found at that running a script after you make a vpn connection can be done
through connection manager (with cmak kit)
But i have a problem with the mapping to the personal folders. here is the
script i am using :

Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "p:"
strRemotepath = \\server\personalfolder\"
StrUserName = objNetwork.UserName
Set objNetwork = WScript.CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive strDriverLetter , strRemotePath&strUserName
Wscript.Quit

The problem is that this is not working because the strUserName resolves to
the username used to login locally to the workstation (in Windows XP/2000).
and not to the username used to setup the vpn connection. So this only works
when the username to login locally to the workstation and the username set
in the vpn connection box are the same. Unfortunaly this is not always the
case (as my network users have their own workstations at home and can choose
wathever login name locally). So i need i way to retrieve the username used
to setup the vpn connection towards the 2003 server. Does anyone know how to
get this through scripting or some other way ? Or does anyone has another
solution to solve my problem (the only thing i need to do is to connect the
p: drive to the personal folder of the connected user)

All help would be welcome

Thanks,


Kris Houben
HyperSoft Belgium
 
 
 

login script after setting up vpn connection

Post by John J. Jo » Wed, 10 Aug 2005 22:17:17

Can you force the user to establish the VPN before logging in? Then they
would be logging in to your domain instead of locally.