Solved

Run a Exe after Successful VPN Connect

Posted on 2003-12-09
13
404 Views
Last Modified: 2010-08-05
Hi,

I have a exe that needs to be executed automatically after every successful VPN connect. We all have Laptops here and we connect to the network thru VPN dial up. And I want one particular exe to run after every successful VPN connection. Cld anyone help me in achieving this? Its very urgent and I wld be very thankful to U all if this problem of mine is solved.

Regards
Irfyy
0
Comment
Question by:Irfyy
  • 5
  • 3
  • 2
13 Comments
 
LVL 35

Expert Comment

by:ShineOn
ID: 9903087
Where do you want this application to run?  On a server, or on the laptop?  Or does it matter?

What OS are you using, both server and laptop?

After a successful connection, what is the first activity by a laptop?  Is it, perhaps, authenticating to a tree or domain?  I HOPE you are forcing these VPN users to log in after establishing their connection, before allowing access to any network services.

You should be able to formulate a login script that runs conditionally when a user logs in through a VPN connection, that would execute your program.  It would be easiest, of course, to have it execute on the laptop in such a case.

There may be a way (I don't recall) to force execution of a program on a server from a client login script.  If there is a way, I'm sure another Expert here will give you appropriate advice.  Otherwise, there are ways to trigger execution based on various events, which could be caused by the login script.
0
 

Author Comment

by:Irfyy
ID: 9903357
Hi,

I want the Application to run on the users Laptop. And this is very much necessary that the Appln runs on the users Laptop.

OS used is Win 2k.

Can we get help on which event can trigger this execution.

Or else, Experts cld U pls shower Ur thoughts on this so that it wld be helpfull for me?

Thanx
Irfyy



0
 
LVL 35

Expert Comment

by:ShineOn
ID: 9903562
If your users are authenticating as users on a Win2K server after making their VPN connection, they should be able to run a login script as part of their login to your domain.  

The login script would contain the command to run the executable.  It would go faster if the laptop already had the executable, but then you have to devise a way to keep the executable up-to-date on all the laptops.  A slow VPN link, especially if it's analog dialup, will make the launch of the program rather slow unless it does reside on the laptop.

Like I said, you should be able to make execution of the program conditional depending on whether the user is connected directly to the LAN or through the VPN.
0
 
LVL 18

Expert Comment

by:chicagoan
ID: 9903581
otherwise create a batchfile that uses rasdial to establish the connection and then executes your application

RASDIAL /PHONEBOOK:phonebookfile
myapp.exe
0
 

Author Comment

by:Irfyy
ID: 9903634
Hey,

if U are talking abt putting this exe in the domain login script, then I wld like to tell U that this exe shld not execute on all domain users desktop. Well let me explain the scene first.

My Appln will be installed on some client desktops' startup folder so that irrespective of whether the user logs in using domain userid or not, the exe will be called on all logons.

So I shld make the exe execute when this user connects to VPN also. All the install details are available in Registry.

Hope the picture is clear now. I want this exe to be executed only on some client desktops who have installed my appln when they connect thu VPN.

Pls help.

And Chicagoan, what is the batch file U were talking abt? Will that serve my purpose now? Cld U pls elaborate?

Thanx
Irfyy
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 35

Expert Comment

by:ShineOn
ID: 9903650
That is why I am saying that this should be conditional on whether or not the user is logging in via VPN.

I know it can be done, but I have to leave for work for about 16 hours, so I will leave it up to the other Experts to help you figure out how.
0
 
LVL 18

Accepted Solution

by:
chicagoan earned 45 total points
ID: 9903678
Create a shortcut to the batch file and have the user use the batch file to connect.
You can use one rasdial isnatance to dial the isp and another to establish the vpn, if necessary.

rasdial /phonebook:isp
rasdial /phonebook:vpn
myapp.exe
0
 

Author Comment

by:Irfyy
ID: 9903743
Chicagoan,
Wht will this do? Execute my exe? How?
0
 
LVL 35

Assisted Solution

by:ShineOn
ShineOn earned 45 total points
ID: 9910681
Someone out there should be able to answer your question after this fashion:

Using a similar example of how conditional execution within a NetWare login script works - you should be able to set an environment variable somehow that indicates that the login is through the VPN - this might be based on a test of the IP address range assigned.

This environment variable must be set prior to execution of the login script.  When the script hits the "if" statement that tests for the environment variable, it would either run the program if the environment variable indicates it is a VPN connection, or it will not run the program if the environment variable indicates that it is not a VPN connection.

That SHOULD be translatable into a similar process for your Windows login script, which is essentially a glorified DOS .BAT file..  

If it CAN'T be done, then that's yet another indication of the superiority of NetWare networks over Windows networks.  If it CAN be done, then I expect to see a post from another Expert explaining to you HOW to do what I just described.

If you don't get a comment from another Expert with how to do what I described in a Windows network environment, then perhaps you can use the information I provided to devise your own solution using the logic-flow I recommended.
0
 
LVL 35

Expert Comment

by:ShineOn
ID: 9910704
Perhaps Chicagoan's comment and my comment can be combined to get a solution.  

The .bat file shortcut Chicagoan recommends could have a SET command in it to set a custom environment variable value that indicates that, since the BAT file was run to make the connection via VPN, the connection is a VPN connection, which then would trigger execution of the program via an IF conditional statement in your login script.

Make more sense now?  Anyone else have more details to help Irfyy get this done?
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Join & Write a Comment

Article by: IanTh
Hi Guys After a whole weekend getting wake on lan over the internet working, I thought I would share the experience. Your firewall has to have a port forward for port 9 udp to your local broadcast x.x.x.255 but if that doesnt work, do it to a …
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now