473,413 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Discover user name given IP address or NetBIOS name

Hi all,

Is there any way to, given an IP address(or NETBIOS machinename - I can
convert from one to other) from my network, and assuming that everyone
needs to log on a NT/2K/Windows Server 2003 Server, to discover the
user name for the user logged on that machine? The final result
desired is something like a table, with pairs [IP(or NB machnename),
username] at the moment the program is run.

Any ideas? I have hunted high and low on the newsgroups and have not
found any kind of solution.

Thanks in advance,

Rafael

Nov 16 '05 #1
4 15868
Rafael,

Nope. The thing here is that there could be no one logged onto the
machine, or there could be multiple users logged onto the machine in
different sessions. You really have no way of knowing.

From what I can tell, the only way to get this information would be to
install an agent on each machine. The only way I can think of to do this
would be to have terminal services installed on the machine and then use the
API for terminal services to see who is logged into that machine.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<rd******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi all,

Is there any way to, given an IP address(or NETBIOS machinename - I can
convert from one to other) from my network, and assuming that everyone
needs to log on a NT/2K/Windows Server 2003 Server, to discover the
user name for the user logged on that machine? The final result
desired is something like a table, with pairs [IP(or NB machnename),
username] at the moment the program is run.

Any ideas? I have hunted high and low on the newsgroups and have not
found any kind of solution.

Thanks in advance,

Rafael

Nov 16 '05 #2
To do it in VBScript with WMI, use
http://www.microsoft.com/technet/scr.../dmlgvb02.mspx

After looking at that, look at the WMI and System.Management classes in the
..Net framework.

To get the user, make sure you set a reference to System.Management.dll

There's a pretty good article at
http://www.csharphelp.com/archives3/archive584.html. Be sure to look for
part II of the article at
http://www.csharphelp.com/archives3/archive585.html for more specific
details.

Hope this helps,

DalePres
MCAD, MCDBA, MCSE

<rd******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi all,

Is there any way to, given an IP address(or NETBIOS machinename - I can
convert from one to other) from my network, and assuming that everyone
needs to log on a NT/2K/Windows Server 2003 Server, to discover the
user name for the user logged on that machine? The final result
desired is something like a table, with pairs [IP(or NB machnename),
username] at the moment the program is run.

Any ideas? I have hunted high and low on the newsgroups and have not
found any kind of solution.

Thanks in advance,

Rafael

Nov 16 '05 #3
Another good link I just found. Chapter 8 code samples has some great
working C# examples of using WMI.
http://www.wbem.co.uk/codesamples/books.shtml

DalePres
MCAD, MCSE, MCDBA

<rd******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi all,

Is there any way to, given an IP address(or NETBIOS machinename - I can
convert from one to other) from my network, and assuming that everyone
needs to log on a NT/2K/Windows Server 2003 Server, to discover the
user name for the user logged on that machine? The final result
desired is something like a table, with pairs [IP(or NB machnename),
username] at the moment the program is run.

Any ideas? I have hunted high and low on the newsgroups and have not
found any kind of solution.

Thanks in advance,

Rafael

Nov 16 '05 #4

If someone is logged on the Explorer.exe process will be running. Query
the remote computer using WMI for that process object. The process
owner will indicate who is logged on. You can even programatically
determine how long that user has been logged in. The defaultuser name
value in the registry can be queried to determine the previously
logged-in user if the Explorer.exe process is not running.

I can supply code if needed.

Jim Evans
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MLH | last post by:
I would like to read a MAC address from at least one NIC in a PC on which I have an Access 97 runtime app installed. What's the least hassel method you know of?
0
by: Rob Levine | last post by:
I have been having some serious problems with System.Net.Dns.Resolve. The documentation states: "The Resolve method queries a DNS server for the IP address associated with a host name or IP...
4
by: Michael Tissington | last post by:
Is it possible to read the NetBIOS domain name and if so how ? -- Michael Tissington http://www.oaklodge.com http://www.tabtag.com
5
by: Hooyoo | last post by:
Hi, here, How to get local machine name and IP address? Thanks.
2
by: martin lanny | last post by:
Simple network scanner is a part of my dotnet solution. It pings ip addresses in a selected network range and gives me the response time for each computer it finds. Anyhow, I would need to...
6
by: DevX | last post by:
Hello, I have a big intranet that I run with IIS 6.0. I need to log the client's machine names, and I found on the web istruction on how to use REMOTE_HOST server variable while enabling...
4
by: madankarmukta | last post by:
HI, I want to set my computername to be greate than 15 bytes.How can i do that since when i set the name greter that 15 bytes it's give me message that "The NetBIOS name of the computer is...
5
by: Steve McKewen | last post by:
I am working on Windows Mobile 6 with VS2005. I want my mobile devices to connect to a shared folder on a PC in an isolated network environment. I don't have a server or router in the network,...
6
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.