1 Attachment(s)
[2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
It's similar to PsLoggedOn from SysInternals but it also more info.
I'm attaching the sources in a zipfile because they're now too long to post in a code block.
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
Trying to get this to work using Visual Basic 2008. I think it has something to do with the ldapBind
'Dim LdapBind As String
'LdapBind = ("LDAP://" & "DC=" & UserDomain & "," & strRootDomain)
If I comment those lines out and then create the directory entry like
Dim deEntry3 As New DirectoryEntry("LDAP://domain.local", "user", "password")
It works, does the previous LdapBind above assume a non secured ldap server??
-Michael
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
@Ginolard: Does this work with WinXP SP2 (what I mean is will it pass thru windows firewall)?
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
Quote:
Originally Posted by stanav
@Ginolard: Does this work with WinXP SP2 (what I mean is will it pass thru windows firewall)?
Yes, it does. Actually I have been experimenting with this method.
http://snippets.dzone.com/posts/show/5478
using the Win32_ComputerSystem
cheers,
Michael
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
Quote:
Originally Posted by mellerbeck
Nope... I tried the code and it didn't work on machines running WinXP SP2 with firewall turned on. An exception was thrown at this line
Code:
queryCollection = query.Get()
The error message is "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)".
The reason I asked was that I had coded something similar to this a while ago and couldn't get it to work with WinXP SP2. I received the same exception everytime my program tried to pull information from a WinXP SP2 machine. I ended up trashing the project because I don't know how to by pass the firewall.
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
The reason I asked was that I had coded something similar to this a while ago and couldn't get it to work with WinXP SP2. I received the same exception everytime my program tried to pull information from a WinXP SP2 machine. I ended up trashing the project because I don't know how to by pass the firewall.[/QUOTE]
Sorry I just read up to the WinXP SP2 part :) so I guess the question is what do you expect? Of course the firewall is going to block it, thats the whole point of a firewall :) You could open the ports allowing WMI access....
http://www.pcreview.co.uk/forums/thread-531724.php
http://support.microsoft.com/kb/875605
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
Yeah that method is all well and good but it won't retrieve a user who is logged on via Terminal Services or one who is logged on locally.
Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)
I've just posted the new version as a zipfile attachment in the original post. Works better with Win2K plus adds command line options.