dcsimg
Results 1 to 8 of 8

Thread: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2006
    Posts
    746

    [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.
    Attached Files Attached Files
    Last edited by Ginolard; May 30th, 2008 at 05:10 AM. Reason: New release
    ManagePC - the all-in-one PC management and inventory tool

  2. #2
    New Member
    Join Date
    May 2008
    Posts
    3

    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

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,292

    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)?
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  4. #4
    New Member
    Join Date
    May 2008
    Posts
    3

    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

  5. #5
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,292

    Re: [2005] Find the logged on user of a remote Win2k/XP machine (Console Application)

    Quote Originally Posted by mellerbeck
    Yes, it does. Actually I have been experimenting with this method.

    http://snippets.dzone.com/posts/show/5478

    using the Win32_ComputerSystem

    cheers,

    Michael
    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.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  6. #6
    New Member
    Join Date
    May 2008
    Posts
    3

    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

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2006
    Posts
    746

    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.
    ManagePC - the all-in-one PC management and inventory tool

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2006
    Posts
    746

    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.
    ManagePC - the all-in-one PC management and inventory tool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width