The user might not be logged on locally, but if you are connecting to the server any other way (through shares, etc.) it will still show the user as logged on (authenticated). It just isn't what is called an "Interactive" logon. All the NetAdmin module is doing, as James pointed out, is calling an API that still exists for legacy support, but doesn't do what you are hoping it would (list the current interactive user, if any).
All a user has to do to be shown as logged on through that function is create any kind of session with the OS that will authenticate the user. Hope that answers your question. What you want to do can be done in many of the ways listened earlier in this thread: calling nbtstat, Pulling values from the registry, WMI. Also www.sysinternals.com has an app called psloggedon that will show interactive logons. Matthew Allen -----Original Message----- From: John Deretich [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 7:02 PM To: 'Krummel, James C - PGGC-6' Cc: Perl-Win32-Admin-Request (E-mail) Subject: RE: win32::netadmin::loggedonusers James, the module that I'm using is Win32::NetAdmin::LoggedOnUsers. When I run this at night, the function tells me that the user is still logged on to the server, but he isn't logged on to the workstation. Can you tell me why? thanks for the help, John -----Original Message----- From: Krummel, James C - PGGC-6 [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 11:23 AM To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: RE: win32::netadmin::loggedonusers John, This is due to a bug in the underlying API that populates this information. Microsoft de-valued the call with Windows XP, but still maintains legacy (aka broken) support for it. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/net mgmt/netwkstasetinfo.asp NetWkstaSetInfo The NetWkstaSetInfo function is obsolete. The function configures a workstation with information that remains in effect after the system has been reinitialized. James Krummel -----Original Message----- From: John Deretich <[EMAIL PROTECTED]> To: "Perl-Win32-Admin-Request \(E-mail\)" <[EMAIL PROTECTED]> Subject: win32::netadmin::loggedonusers Date: Tue, 11 Mar 2003 17:57:00 -0800 Hi, I was wonder if anyone was familiar with win32::netadmin::loggedonusers. When I run this at night, the function tells me that the user is still logged on but he isn't. Can anyone tell me why? Here's a snippet of my code that I'm running: Win32::NetAdmin::LoggedOnUsers($Machines, \%users); if ( my ($user, $info) = ( sort each %users ) ) { ($u, $domain, $logon_server) = split(/;/, $info); if ($u !~ /\$/i) { write(LOGGEDONUSERS); } } else { } please advise, John _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
