473,769 Members | 7,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 15896
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.co m

<rd******@gmail .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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.Manageme nt classes in the
..Net framework.

To get the user, make sure you set a reference to System.Manageme nt.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.goo glegroups.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.goo glegroups.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
2136
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
1295
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 address." "When hostName is a DNS-style host name associated with multiple IP addresses, only the first IP address that resolves to that host name is returned."
4
3649
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
72355
by: Hooyoo | last post by:
Hi, here, How to get local machine name and IP address? Thanks.
2
4764
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 retrieve two more pieces of information for each active (local network) IP address: - Computer's Host Name - Mac Address
6
3594
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 Reverse DNS on IIS. Using also a query to the DNS retrieves only the names of machine that are registered in the DNS (like servers).
4
7060
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 limited to 15 bytes" . Can anybody tell me how can i edit this limit of 15 bytes of NetBIOS name ..? Thanks!
5
2134
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, so don't have a DNS server. I can ping the PC using its IP address, but not its hostname. I have written a ping routine using a dotnet socket to send an IcmpPacket. I can connect to the shared folder by the hostname but not the IP address. I am...
6
4211
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 recommended. If anyone has some suggestions, I'd love to give them a try - this is driving me nuts!! I am connected via wired-LAN to a Linksys WRT-600N router; there are 4 other computers on the network. The other 3 computers are working perfectly...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.