Page 2 of 2 <12
Topic Options
#62912 - 2002-02-12 01:01 AM Re: Where is user JDOE logged in at?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Alex,

Sorry.. I am on the road this week. All of my code is back home.

I maybe able to piece something together this week, but I am in the process of getting two rather significant projects.

Thanks!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#62913 - 2002-02-19 07:23 AM Re: Where is user JDOE logged in at?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Alex,

Ok.. I am back to some degree (but, I feel with the dozen database projects or so I just recieved from the main office, I may become scarce).

Here is what I was able to find with regard to this

code:

; REF - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/iadssession_property_methods.asp
; -- Converted to Kix
; Bind to a file service operations object on "myComputer" in the local domain.
$fso = GetObject("WinNT://myComputer/LanmanServer")
; Enumerates sessions
If fso <> ""
For Each $session In $fso.sessions
?"Session Computer: " + $session.Computer
?"Session User: " + $session.User
Next $Session
EndIf

Have fun!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#62914 - 2002-02-20 12:39 AM Re: Where is user JDOE logged in at?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
Kent,
Didn't have any time for this (or for lots of other stuff too and it won't change for some times )
But the little i've just seen, session give you ConnectTime, and also ComputerPath and UserPath properties
You can use them to get your hand on the user and computer objects, using WinNT:// or LDAP:// (depends of the Path the property gives)
I'm sure you'll be able to do all you want with this.

Too bad, i've got a script in mind for this, but not the time to make and test it.
It would be something like that (easy one, but you got the point) :

code:

$fso = GetObject("WinNT://DomainServerName/LanmanServer")
; Enumerates sessions
If fso <> ""
For Each $session In $fso.sessions
$oCurrentUser=getobject("LDAP://"+$session.userpath)
$oCurrentComputer=getobject("LDAP://"+$session.userpath)
$CurrentSessionInfo={
$oCurrentUser.samaccountname
$oCurrentUser.Fullname
$oCurrentUser. everything you want that is available, like AdsPath, CN, ...
$oCurrentComputer.Name ...
$session.ConnectTime
}

Recordinfile($CurrentSessionInfo)

Next $Session
EndIf


Function Recordinfile($TextToOutput)

endfunction


I've designed this one assuming the User/Computer Path properties return the full LDAP path. If not, go on WinNT://
Get a look here for LDAP object properties

[ 19 February 2002: Message edited by: Alex.H ]

_________________________
? getobject(Kixtart.org.Signature)

Top
#62915 - 2002-02-22 03:59 PM Re: Where is user JDOE logged in at?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Alex,

Looking the progress of this thread and where we have been going with it.. I still like krabourn's answer with NTNAME. However, it does not appear to look for a secondary login. That is if the user is logged in on secondary workstation or Terminal Server session. Who else outside of IT, would be logged in multiple times, right? I still think NETBIOS is the "magic" key here as going to the PDC, BDC or the Forest model under Windows 2000+ would not only be costly in code but execution time too. Now, that I have gone off the deep-end, I have probably totally lost the concept of what is going on here. :P

If I get a moment or two today, I will look at the LDAP thread you pointed out.

Thanks again,

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 611 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org