Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to run a script when users logon due VPN

1,198 views
Skip to first unread message

pieter

unread,
Jul 9, 2007, 9:46:03 AM7/9/07
to
I.ve got everthing in order. VPN connections works just fine. I only want to
run a script only when vpn users conecting. I don't want that this script
runs when ordinairy lan users connecting.

Can someone give me some ideas.

thx in advance.
pieter

pieter

unread,
Jul 9, 2007, 10:00:05 AM7/9/07
to
Im sorry, but im am using sbs2003 r2 and winxp clients.
Maybe thats also a nice thing to know.

Cris Hanna [SBS-MVP]

unread,
Jul 9, 2007, 10:31:46 AM7/9/07
to
Do you have a persistent site to site VPN or is the PC making the connection
each time?

--
Cris Hanna [SBS-MVP]
-------------------------------------------------
Microsoft MVPs
Independent Experts (MVPs do not work for MS)
Real World Answers
---------------------------------------------------------
Please do not contact me directly regarding issues

"pieter" <pie...@discussions.microsoft.com> wrote in message
news:0BC265E3-EBA9-4841...@microsoft.com...

Lanwench [MVP - Exchange]

unread,
Jul 9, 2007, 10:29:00 AM7/9/07
to

It would be unusual for any login script to run over a client VPN
connection. Are you using the native PPTP VPN or a third party client? Or,
is this a site-to-site VPN setup?


pieter

unread,
Jul 9, 2007, 11:42:03 AM7/9/07
to
Dear cris

Thx for the response.

The client pc's are making the vpn connection.
After the vpn is esthablised i will be able to run a script ( not the login
script) from the sbs server to f.i map some drives.

I want to initiate this from the server and not make a tool or a persitent
drivemapping on the client.

suprise me.

pieter

unread,
Jul 9, 2007, 11:46:00 AM7/9/07
to
thx for the reply

it's just the native pptp ( poort 1723) vpn. A remote vpn user initiates the
vpn tunnel.
After this i wish to run a script ( not the login script) to make some
mappings or run a program.
But this must only apply the remote users who are connecting via the VPN
tunnel.

I hope this shine a light in the darkness.

thx

Cris Hanna [SBS-MVP]

unread,
Jul 9, 2007, 12:05:38 PM7/9/07
to
The whole purpose of the logon script is to perform the actions you mention

Logon script, however, does not run if you logon and then create VPN
You can however logon, and then have a shortcut on the users desktop which
they could run as needed. But the server is not going to initiate this

--
Cris Hanna [SBS-MVP]
-------------------------------------------------
Microsoft MVPs
Independent Experts (MVPs do not work for MS)
Real World Answers
---------------------------------------------------------
Please do not contact me directly regarding issues

"pieter" <pie...@discussions.microsoft.com> wrote in message

news:83C67CD9-7C75-4F39...@microsoft.com...

pieter

unread,
Jul 9, 2007, 1:16:02 PM7/9/07
to
Oke chris,

thx

Ok then will generate a remote.cmd and offer this in sharepoint envirement.
So the users can save this at the desktop and run this if they want to.

It would be a nice feature to have this included in SBS, it wil always be
nice to run several commands just to the remote users.

But we have to workaround it. Thx for the advice.

regards
pieter

kj [SBS MVP]

unread,
Jul 9, 2007, 1:22:03 PM7/9/07
to
pieter wrote:
> Dear cris
>
> Thx for the response.
>
> The client pc's are making the vpn connection.
> After the vpn is esthablised i will be able to run a script ( not the
> login script) from the sbs server to f.i map some drives.
>
> I want to initiate this from the server and not make a tool or a
> persitent drivemapping on the client.
>
> suprise me.
>

Check the checkbox "login using dial-up connection". Then choose the Network
VPN connection. You *should* then get your logon script executed. It's been
a long time since I tried this, but let us know if it still does!

>
> "Cris Hanna [SBS-MVP]" wrote:
>
>> Do you have a persistent site to site VPN or is the PC making the
>> connection each time?
>>
>> --
>> Cris Hanna [SBS-MVP]
>> -------------------------------------------------
>> Microsoft MVPs
>> Independent Experts (MVPs do not work for MS)
>> Real World Answers
>> ---------------------------------------------------------
>> Please do not contact me directly regarding issues
>>
>> "pieter" <pie...@discussions.microsoft.com> wrote in message
>> news:0BC265E3-EBA9-4841...@microsoft.com...
>>> Im sorry, but im am using sbs2003 r2 and winxp clients.
>>> Maybe thats also a nice thing to know.
>>>
>>>
>>>
>>> "pieter" wrote:
>>>
>>>> I.ve got everthing in order. VPN connections works just fine. I
>>>> only want to
>>>> run a script only when vpn users conecting. I don't want that this
>>>> script runs when ordinairy lan users connecting.
>>>>
>>>> Can someone give me some ideas.
>>>>
>>>> thx in advance.
>>>> pieter

--
/kj


pieter

unread,
Jul 9, 2007, 3:54:04 PM7/9/07
to
Dear KJ

that's only possible when a computer is added in the computer domain. But i
want to do this without the computer is added to my domain.

Just run plain xp, starts the builtin vpn tool from SBS, connect .
At this point run a script.

But i think cris wrote the right answer. It is not possible to initiate that
from the server because it is not already set which mappings and paths are
made.

The only trigger is a change of a ip. i'll think i will dive in tot that
option.

bye

kj [SBS MVP]

unread,
Jul 9, 2007, 4:12:47 PM7/9/07
to
pieter wrote:
> Dear KJ
>
> that's only possible when a computer is added in the computer domain.
> But i want to do this without the computer is added to my domain.
>
> Just run plain xp, starts the builtin vpn tool from SBS, connect .
> At this point run a script.
>
> But i think cris wrote the right answer. It is not possible to
> initiate that from the server because it is not already set which
> mappings and paths are made.
>
> The only trigger is a change of a ip. i'll think i will dive in tot
> that option.
>
> bye

Yes, that does make a difference. Perhaps launch your VPN connection
initiation from a script and then map the drives later after connection.

--
/kj


Paul Benn

unread,
Jul 10, 2007, 5:08:03 PM7/10/07
to
Hi,

If you create a VPN connection via the Connection Manager Administartion Kit
within SBS2k3 you can add a Post Connection Action (Run a script).

you then distribute the small executable to the clients

I think this will produce the functionality you require.

Paul

p.s. There are many more options in the CMAK, that can be very useful!!

Ole

unread,
Aug 27, 2007, 4:26:02 PM8/27/07
to
Hi, this works....

1. Install and run the Connection Manager Administration Kit on the SBS
server!
2. Choose New Profile - Next
3. Type inn your service name (companyname) and filename (sbsvpn).
4. Do not ad a realname - Next.
5. Next on the Merge profile info page.
6. VPN support page - Choose "Phone book from this profile.Choose Always use
the same VPN server. Type inn your server internett IP or name.
7. Choose Next on the VPN Entries.
8. Clear the Automatic download phone book updates - Next.
9. Next on the dialup network entries.
10. Next on the routing table.
11. next on proxy.
12. On custom action page, choose Post-Connect in the action type. Choose New.
13. Type your desription (Map network), choose Include the custom action
with this service profile.
14. In the program to run brows to your Map Network file. I have created a
MapShare.vbs file prior to this.
15. OK and then Next.
16. If you want add a Logon Bitmap. Then Next - Next - Next - next - Next.
17 remember where the file was created. Finish.
18. Copy your file C:\Program Files\Cmak\Profiles\SBSVPN\SBSVPN.exe to
C:\ClientApps\Connection Manager\
19. Rename the sbspackage.exe file to old-sbspackage.exe. Rename the
SBSVPN.exe to sbspackage.exe Then copy this to
C:\Inetpub\Remote\sbspackage.exe
20. You might have to restart your server. if not you will get the old
sbspackage.exe from somewere, cant find out why.
20. Your users are now ready to install the new VPN file from the Remote web
workplace - download connection manager

Her is the MapShare.vbs
' MapShare.vbs - Map Network Share
' Author Ole H Røtterud http://www.helsedata.com/
' Version 1.0 - Januar 10th 2007
' -----------------------------------------------------------------'

Option Explicit
Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3, strRemotePath4
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strDriveLetter4

strDriveLetter1 = "H:"
strDriveLetter2 = "I:"
strDriveLetter3 = "J:"
strDriveLetter4 = "K:"
strRemotePath1 = "\\SBSServername\Share1"
strRemotePath2 = "\\SBSServername\Sale"
strRemotePath3 = "\\SBSServername\Admin"
strRemotePath4 = "\\SBSServername\Development"

On Error Resume Next

Set objNetwork = CreateObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3
objNetwork.MapNetworkDrive strDriveLetter4, strRemotePath4

Wscript.Quit

Try it out.

0 new messages