Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / June 2004

Tip: Looking for answers? Try searching our database.

enumerating logged on users, detecting logon/logoff

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alen Ilkov - 24 Jun 2004 18:56 GMT
I am trying to get the list of all the users logged on to a WinNT/2k/XP box.
What I am about to use is NetWkstaUserEnum from the NetAPI lib - is that the
best way?

Also, is there a way to hook into windows logon to be notified when new
users log on and existing users log off? Alternatively I could call
NetWkstaUserEnum periodically, but that's cumbersome.

thx,
Alen
Eugene Gershnik - 24 Jun 2004 22:10 GMT
> I am trying to get the list of all the users logged on to a
> WinNT/2k/XP box. What I am about to use is NetWkstaUserEnum from
> the NetAPI lib - is that the best way?

As per MSDN this API lists interactive, service and batch logons only. If
you want more than that the best way is

LsaEnumerateLogonSessions
LsaGetLogonSessionData

> Also, is there a way to hook into windows logon to be notified when
> new users log on and existing users log off?

Yes and no. Yes because there is a way to hook into anything Windows does
including LsaApLogonUserXXX that does the actual job. (I once wrote a
product that did exactly that). No because this isn't what I would call
normal application design.

Could you tell why do you need this information? In my experience 9 times
out of 10 this is unnecessary.

--
Eugene
Victor Pereira - 26 Jun 2004 18:43 GMT
Hi, can i use LsaGetLogonSessionData to check if my user had logged on a
Netware ?

Thanks,

VP

> > I am trying to get the list of all the users logged on to a
> > WinNT/2k/XP box. What I am about to use is NetWkstaUserEnum from
[quoted text clipped - 19 lines]
> --
> Eugene
Eugene Gershnik - 27 Jun 2004 07:50 GMT
> Hi, can i use LsaGetLogonSessionData to check if my user had logged
> on a Netware ?

Check AuthenticationPackage member of SECURITY_LOGON_SESSION_DATA. My guess
is that it will contain a name of some netware authentication package (maybe
NETWARE_AUTHENTICATION_PACKAGE_V1_0).

--
Eugene
Raj - 28 Jun 2004 12:03 GMT
> I am trying to get the list of all the users logged on to a WinNT/2k/XP box.
> What I am about to use is NetWkstaUserEnum from the NetAPI lib - is that the
[quoted text clipped - 3 lines]
> users log on and existing users log off? Alternatively I could call
> NetWkstaUserEnum periodically, but that's cumbersome.

You can implement "WinLogon notification package" (nothing but a simple DLL) to monitor and respond to Winlogon events.

In order for your package to receive event notifications from Winlogon, you must register -- the name of the package, the names of the event handler functions in the package, the DLL responsible for implementing the package

I hope this is the best way to hook logon/off events.

- &Raj.

> thx,
> Alen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.