How to Determine Whether a Client Is Connected by RAS or LAN

Last reviewed: November 14, 1997
Article ID: Q173530
The information in this article applies to:
  • Microsoft Windows NT Server versions 3.51 and 4.0 --------------------------------------------------------------------------

SUMMARY

You may want to know whether a user is connected by Remote Access Service (RAS) or the local area network (LAN) if you use logon scripts to map drives or to set environment variables when a user logs on to a domain. This can be especially helpful if the logon script contains a large number of commands. This article discusses one method of determining if a user is connecting by RAS.

MORE INFORMATION

Microsoft Systems Management Server includes a utility, Netspeed.com, that checks to see if a user has a slow connection. This utility, however, does not verify that there is an active RAS connection on the client.

For more information on Netspeed.exe, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q131011
   TITLE     : SMS: NETSPEED.COM Internals

The Backoffice Resource Kit includes Checkras.exe, a utility that checks for RAS connections on the client instead of trying to determine the link speed. You can use the Checkras.exe utility in your logon script to check whether a user is connected by a RAS connection, and then include commands in your logon script based on the results returned by Checkras.exe.

The following is a sample Windows NT domain logon script that uses Checkras.exe:

   echo Beginning of logon script

   echo Checking for existence of Checkras.exe
   if exist %windir%\checkras.exe goto yes
   copy \\server\netlogon\checkras.exe %windir%

   :yes
   echo Checking for RAS connection
   %windir%\checkras
   if errorlevel 1 goto ras
   echo This is not a RAS connection
   pause
   goto end

   :ras
   echo This is a RAS connection
   pause

   :end


Additional query words: sms
Keywords : kbhowto kbinfo ntdomain nthowto NTINTEROP ntnetserv NTSrv kbinterop kbnetwork
Version : WinNT:3.51,4.0
Platform : winnt
Issue type : kbhowto kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.