CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2011
    Posts
    7

    Username -> Hostname/IP

    Hello,

    Inside a network (where username is unique) how can i convert a username to an ip? A method once existed using net send and netstat. Just can't find anything which can be used to establish a unique port to a computer using a username.
    Is there any other methode of doing that or some script which is able to do that?
    Thanks,
    Gabriel

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Username -> Hostname/IP

    What kind of NETWORK? You mean, like THE INTERNET?

    Inside a network, Active Directory can find computer information.

    Ping gives a MACHINE NAME (with -a option).

    How are you getting the USER NAME?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Username -> Hostname/IP

    I am not aware of anyway to query a network and get the Home IP address of a machine based on a userID, unless of course that user is currently logged into your program via IP from the workstation in question, in which case the remote IP will be the users IP. Still the username has nothing to do with it.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jun 2011
    Posts
    7

    Re: Username -> Hostname/IP

    hey,
    no. the machine is also connected to the internet, but i'm talking about a network which is managed by a DC server (active directory) and has a unique username (no 2 usernames). i can resovle (theoretically) the user name if the machines were windows xp with a "net send" command, but with the new "msg" command, it does not seem to find the user name.

  5. #5
    Join Date
    Jun 2011
    Posts
    7

    Re: Username -> Hostname/IP

    Quote Originally Posted by DataMiser View Post
    I am not aware of anyway to query a network and get the Home IP address of a machine based on a userID, unless of course that user is currently logged into your program via IP from the workstation in question, in which case the remote IP will be the users IP. Still the username has nothing to do with it.
    There are work-around like (in win XP) the net send command and then the netstat command to find open netbios but in that case it is able to send a message to the user with only a username and create a conversion into an IP address.
    would love something like that but the new msg command in win7 can't seem to send the message with a username...

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Username -> Hostname/IP

    Remote Powershell
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Jun 2011
    Posts
    7

    Re: Username -> Hostname/IP

    Excuse me for being ignorant, but how does PowerShell allows me to resolve it?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured