#62914 - 2002-02-20 12:39 AM
Re: Where is user JDOE logged in at?
|
Alex.H
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
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
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 858 anonymous users online.
|
|
|