Command Line (Batch) Disconnect User

  • Thread starter Thread starter Newscene
  • Start date Start date
N

Newscene

Is there a way to force a RAS client to dicsonnect using a command line
(batch)?

I have a network monitor running that test a number of system services,
server, functions, etc. This monitor is capable of firing a command line or
batch if it detects that a function, server, etc., has "failed". In this
case we are monitoring a remote function over a VPN RAS and it periodically
fails to respond. However if we disconnect the RAS it will dial in again by
itself and we can monitor it again.

So I'm looking for a way to force the dicsonnect when we detect it isn't
responding and thus force it to redial and reestablish the connection.

Thanks
 
Newscene said:
Is there a way to force a RAS client to dicsonnect using a command line
(batch)?

RasDial -- it's in System32 on the path.

RasDial /?

rasdial [entryname] /DISCONNECT
I have a network monitor running that test a number of system services,
server, functions, etc. This monitor is capable of firing a command line or
batch if it detects that a function, server, etc., has "failed". In this
case we are monitoring a remote function over a VPN RAS and it periodically
fails to respond. However if we disconnect the RAS it will dial in again by
itself and we can monitor it again.

So I'm looking for a way to force the dicsonnect when we detect it isn't
responding and thus force it to redial and reestablish the connection.

There is also some code in MSDN samples I think if RasDial
doesn't do it.

Probably VBS too.
 
assuming you want to disconnect the RAS client from the server, this how to may help, quoted http://howtonetworking.com.

How to manage RRAS using command lines



In some cases, you may want to manage RRAS using command lines. For example, you may not want any one use the VPN to access the office network at day and restart it at evening. How do you do that?



Yes, you can stop and re-start RRAS from the command prompt. The command net stop/start rasman stops/starts all three RAS-related services - Remote Access Autodial Manager, Remote Access Connection Manager, and Remote Access Server.



In our above example, you may want to create a batch file including net stopt rasman to stop VPN at 8:00 AM and net start rasman to re-start it at 7:00 PM.



You can also pause the RRAS server with the net pause rasman command. Pausing the RRAS service keeps any new VPN users from accessing the server, but existing users can continue their work until they logoff.


Don't send e-mail or reply to me except you need consulting services. Posting on MS newsgroup will benefit all readers and you may get more help.

Bob Lin, MS-MVP, MCSE & CNE
How to Setup Windows, Network, Remote Access on http://www.HowToNetworking.com
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
This posting is provided "AS IS" with no warranties.
I recommend Brinkster for web hosting!

Is there a way to force a RAS client to dicsonnect using a command line
(batch)?

I have a network monitor running that test a number of system services,
server, functions, etc. This monitor is capable of firing a command line or
batch if it detects that a function, server, etc., has "failed". In this
case we are monitoring a remote function over a VPN RAS and it periodically
fails to respond. However if we disconnect the RAS it will dial in again by
itself and we can monitor it again.

So I'm looking for a way to force the dicsonnect when we detect it isn't
responding and thus force it to redial and reestablish the connection.

Thanks
 
Thanks, but we want to force disconnect from the server end, not the client
(rasdial) end


Herb Martin said:
Newscene said:
Is there a way to force a RAS client to dicsonnect using a command line
(batch)?

RasDial -- it's in System32 on the path.

RasDial /?

rasdial [entryname] /DISCONNECT
I have a network monitor running that test a number of system services,
server, functions, etc. This monitor is capable of firing a command line or
batch if it detects that a function, server, etc., has "failed". In this
case we are monitoring a remote function over a VPN RAS and it periodically
fails to respond. However if we disconnect the RAS it will dial in again by
itself and we can monitor it again.

So I'm looking for a way to force the dicsonnect when we detect it isn't
responding and thus force it to redial and reestablish the connection.

There is also some code in MSDN samples I think if RasDial
doesn't do it.

Probably VBS too.
 
From this and the article linked I take it there is no way to disconnect and indovidual connection, only kill them all by stopping RRAS?


assuming you want to disconnect the RAS client from the server, this how to may help, quoted http://howtonetworking.com.

How to manage RRAS using command lines



In some cases, you may want to manage RRAS using command lines. For example, you may not want any one use the VPN to access the office network at day and restart it at evening. How do you do that?



Yes, you can stop and re-start RRAS from the command prompt. The command net stop/start rasman stops/starts all three RAS-related services - Remote Access Autodial Manager, Remote Access Connection Manager, and Remote Access Server.



In our above example, you may want to create a batch file including net stopt rasman to stop VPN at 8:00 AM and net start rasman to re-start it at 7:00 PM.



You can also pause the RRAS server with the net pause rasman command. Pausing the RRAS service keeps any new VPN users from accessing the server, but existing users can continue their work until they logoff.


Don't send e-mail or reply to me except you need consulting services. Posting on MS newsgroup will benefit all readers and you may get more help.

Bob Lin, MS-MVP, MCSE & CNE
How to Setup Windows, Network, Remote Access on http://www.HowToNetworking.com
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
This posting is provided "AS IS" with no warranties.
I recommend Brinkster for web hosting!

Is there a way to force a RAS client to dicsonnect using a command line
(batch)?

I have a network monitor running that test a number of system services,
server, functions, etc. This monitor is capable of firing a command line or
batch if it detects that a function, server, etc., has "failed". In this
case we are monitoring a remote function over a VPN RAS and it periodically
fails to respond. However if we disconnect the RAS it will dial in again by
itself and we can monitor it again.

So I'm looking for a way to force the dicsonnect when we detect it isn't
responding and thus force it to redial and reestablish the connection.

Thanks
 
Newscene said:
Thanks, but we want to force disconnect from the server end, not the client
(rasdial) end

Then you should have said that instead of "force a RAS client
to disconnect" but it may still work.

It has a name and the tool may work from the server side although
I haven't tried that.

You should also look at NetSh.exe (on the server) which might
do it. (See the RRAS sub-area.)

Or worst case, Use PSExec on the Server to invoke the rasdial
program on the Client.
 
Back
Top