Integrate security system with win2000

Posted on 2003-03-24
Medium Priority
Last Modified: 2011-10-03
I'm writing a program that i want to serve as a secondary user authentication to windows 2000, i.e. After u logon to the machine that the program is on the application will ask for more user details other than that which win2000 requires. My problem is i don't know a way that i can tell when a user wants to or has logged on to a system via a network. I'm looking for a guide as to how to approach the problem, if i can get started i know i can figure out the rest. If anyone know where i could get some reference material that would be of great help.
Question by:shizzle
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Expert Comment

ID: 8198021
Depending upon just how integrated you want to be here...

One way is to simply have a process/program that fires up when the user logs in.  The program can than get the current user and the do what ever else you want it to do.

Maybe some additional info as to just what you want to be able to do once you have the user's additional info; i.e., log them off, prevent them from getting on in the first place, etc.

Author Comment

ID: 8198325
[advapp ] I was thinking the same thing except that i would like the program to be running at all times, this way i would need to know when someone uses the win2000 authentication system, that way when sin2K is finished it would pass the user on to my program. Once i get the user info i want to be able to run more rigid authentication tests on that user (i.e) they would have another user name and password that is needed for my program if they fail to enter this correctly as specified by the program i want to log them off. When u speak of firing up the program when someone logs on r u talking something like spawning the process from another process?  

Expert Comment

ID: 8199296
I've done similar things by using a program that runs from the startup list in the registry.  Though it is not fool-proof (to those who know the registry) there are ways to make it so you at least know when/who buggered with the program, if they do.

Is there a specific reason you want this to run even when someone is not logged in?  If that is important to the probject, maybe you should consider creating it as a service -- which does run all the time.  At the moment, I don't know of a way to hook it into the security system but it could certainly do a sleep-and-poll method to see who (if anyone) is logged in.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8199438
[advapp] I think i like what u r saying. Would it be possible for u to show me some code example as to how u did what u did? My program will validate users from a database created by me and will be maintained by the system admin. via a customised UI. I really just want to know how i can start get my program going after win2k has finished doing what its doing and also get the info pertaining to the current user info. You have been of quite some help alreay just by ur guidance. Thanks. [the points r urs, just need a bit more help]

Accepted Solution

advapp earned 400 total points
ID: 8204239
The text below can be edited, then pasted into a REG file and merged into the registry to establish the startup process.  Just change "ProgramName" to what ever you commonly call your program and "PROGRAM.EXE" to the actual name of the executable along with any necessary arguments.  Once in place, whenever any user logs in, the program will run.  Note that this will occur after the system has validated them as a user.

Windows Registry Editor Version 5.00


The only way someone can get around this is: 1) remove the entry in the registry, or 2) using the task manager to kill the program.  Within the program, set a status flag that can be evaluated should the program be terminated abnormally.  As the program progresses, it updates this value to indicate the progress made.  It starts by checking the status of this flag from the last time the program was run.  If it indicates abnormal termination in the last session, it then prevents the user from continuing, tells them to talk with the administrator to get it rectified, and logs off the session.  If the status looks ok, processing continues by setting a value that assumes the user killed the program via task manager -- assuming the worst.

In my program there is an initial form that displays some information to the user about their session and the user can either close it manually, or the form will time-out after 10 seconds.  In either case, the form is not unloaded but only hidden.  Within the Form_QueryUnload event of this form, I Case the UnloadMode value to determine what/who is unloading it and set this status flag appropriately.  If the user kills the program, I can evaluate the status and see that it shows the original value -- indicating the user killed the program via task manager.  If the form is closed through orthodox means, the status is updated appropriately by the QueryUnload event.

Now, whether this process is secure enough for your situation, you'll have to decide.  If you really want something unavailable to the user you may be better off going with a service.

Expert Comment

ID: 8204270
Some code for the QueryUnload event:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    Select Case UnloadMode
    Case vbFormControlMenu
        'User closed window
        Cancel = 1
    Case vbFormCode
        'Closed by program via Unload <frm>
        'Ensure that it continues to show killed if that was status at the beginning
        If SessionTerm <> TERM_TSKMGR _
          And SessionTerm <> TERM_PREVENT Then
            'Set status to show session ended by program
        End If
    Case vbAppWindows
        'Set status to show user logged off of session
    Case vbAppTaskManager
        'Process killed via Task Manager
    End Select

End Sub

Expert Comment

ID: 8531705
Hi shizzle,
This old question (QID 20561319) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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