Capturing a logon event

  • Thread starter Thread starter Venkat
  • Start date Start date
V

Venkat

Hi

I am trying to limit the number of sessions that a single user has on
a TS.

For this I thought I can write a service that will run always. When a
logon occurs, It will make an entry to a database (or text file). On a
subsequent logon by the same user it will check with the file and if
the count is more than what is permitted, it will log him off.

But the problem is, how can my service know when a user is logging on.
Is there some API or event or something for this.

Or is there some other way of doing this.

Regards
Venkat
 
In Windows 2003 TS, there is a Group Policy option to limit users
to one session.
On W2K, you could use a freeware utility to do this:
LockSingleUser from http://thethin.net/r25b.zip

If you want to write your own service to do this, you could either
check the Security part of the EventLog, where every logon and
logoff is recorded (provided you have auditing of security events
enabled), or you could create your own text-based logfile by added
the following line to your logon script:

echo %username% %clientname% %date% %time% >> logon.log

--
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
http://hem.fyristorg.com/vera/IT
--- please respond in newsgroup ---

(e-mail address removed) (Venkat) wrote in
 
Back
Top