System to record when an employee logs into their PC using VB.Net and SQL Database

A

andrewCMF

Hello

I hope this is posted in the correct place, if not the can some point
me in the direction of a suitable Google group.

ok, here's my problem......

When an employee logs into their PC, we want to record the "log in"
time and then the "log off" time at the end of the day and record the
two times in a SQL Database. This is for the purpose of working out
the total hours worked by an employee as we are trailing an flexi-time
system and need to know when someone comes in to work.

I would like to use VB.Net to program such a system but at a bit of a
loss as to...

1/ how to get the employee's username from the PC
2/ how to put the employee's username into the DB

any help or pointers to websites that might help would be grand

cheers

Andrew
 
R

rowe_newsgroups

1/ how to get the employee's username from the PC

Environment.UserName
2/ how to put the employee's username into the DB

SqlConnection, SqlCommand

Thanks,

Seth Rowe
 
G

Guest

Hello

I hope this is posted in the correct place, if not the can some point
me in the direction of a suitable Google group.

ok, here's my problem......

When an employee logs into their PC, we want to record the "log in"
time and then the "log off" time at the end of the day and record the
two times in a SQL Database. This is for the purpose of working out
the total hours worked by an employee as we are trailing an flexi-time
system and need to know when someone comes in to work.

Are you on an Active Directory?
 
G

Guest

Pointer: I rarely log off my machine, but rather leave it logged in
overnight, everynight. I shut down Friday nights. This is necessary for
pushed updates, backups, etc.
 
A

andrewCMF

Hello

Seth Rowe - Thanks for you reply, Ta.

Spam Catcher - yes we do use active directory. we are running sbs2000
(upgarding to sbs2003 in the not to distant future). Is there
something in there that we can use to log the time an employee logs in
and off?

cheers

Andrew
 
A

andrewCMF

Hi Family tree Mike,

Thanks for the pointer, it is a valid point however all our employee's
know to log off at night for security reasons, although they due leave
PCs on for updates as you mentioned.

cheers

Andrew
 
G

Guest

Spam Catcher - yes we do use active directory. we are running sbs2000
(upgarding to sbs2003 in the not to distant future). Is there
something in there that we can use to log the time an employee logs in
and off?

Yes, LogOn/LogOff Auditing is built into Windows/ActiveDirectory:

http://technet.microsoft.com/en-us/library/Bb742436.aspx

You'll then need an EventLog reporting program to generate fancy reports.
Or you can build a service to read the event log and dump the records to a
database.

This method should be more reliable than building a client application as
you're relying on the server's authentication process and everything is
located on your central servers.

Here's some quick code on how to read the event logs:

http://www.freevbcode.com/ShowCode.asp?ID=5658
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top