473,396 Members | 1,767 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,396 software developers and data experts.

Discovering Whose Logged On To Remote System?

All:

I am writing a "net send" like application. The application runs on each
person's PC, waiting for messages.

Let's suppose "Joe" is logged in to 2 PCs, A and B. I would like to enter
acommand (from my PC) like: sendto joe hello

I would then like a window to pop up on PC A and PC B with "hello." In
order to do this, I need a way to determine all of the computers where Joe
is logged in as user.

the psuedocode is something like:

foreach (node on the network) {
if (user logged in is target_user) {
send target_user the_message
}
}

Is this possible?

Thanks,
John
Nov 16 '05 #1
2 3633
Hi John
I think there must be a way to do that as long as you are on the same
network.
Try to look at the sample on that link
http://www.codeproject.com/useritems/NetSendPlus.asp
Hope it could help
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2

"John Puopolo" <jo**********@fastsearch.com.nospam> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
All:

I am writing a "net send" like application. The application runs on each
person's PC, waiting for messages.

Let's suppose "Joe" is logged in to 2 PCs, A and B. I would like to enter
acommand (from my PC) like: sendto joe hello

I would then like a window to pop up on PC A and PC B with "hello." In
order to do this, I need a way to determine all of the computers where Joe
is logged in as user.

the psuedocode is something like:

foreach (node on the network) {
if (user logged in is target_user) {
send target_user the_message
}
}

Is this possible?


Yes, using System.Management and WMI.
Note that this requires access privileges to the remote systems WMI service
to run.

string machineName = "remote";
ConnectionOptions options = new ConnectionOptions();
options.Username = "someuser"; //user (domain or local) with sufficient
privileges to access the remote system through WMI
options.Password = "secret";
ManagementScope s = new ManagementScope("\\\\" + machineName +
"\\root\\cimv2", options);
ManagementPath p = new ManagementPath("Win32_ComputerSystem.Name='" +
machineName +"'");
using(ManagementObject cs = new ManagementObject (s, p, null ))
{
cs.Get();
Console.WriteLine(cs["UserName"]);
}

Willy.
Nov 16 '05 #3

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

Similar topics

4
by: Akhlaq Khan | last post by:
we are developing an intranet application (web based) which needs to detect the logged in user ID of the user hitting the website. the intranet is huge and based on win2k active directory (around...
1
by: John Puopolo | last post by:
All: I am writing a "net send" like application. The application runs on each person's PC, waiting for messages. Let's suppose "Joe" is logged in to 2 PCs, A and B. I would like to enter...
0
by: John Whitmer | last post by:
I am trying to put together a web page to show remote users which PC's are available for RDP so they can use. The page work's fine except for when the goes to the pc to pull the info on if anybody...
0
by: fadi | last post by:
Hey guys, I've been working on this for few days with no luck. I need to create folders and files on a remote server using UNC Path. This works great as long as the user can authenticate first,...
0
by: Satish | last post by:
Scheduled Tasks (.Net ) does not run when server is logged off (Windows 2003): I have a .net executable (command line exe) which performs certain business operations. I can run the program...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
0
by: BLUE | last post by:
EventLogPermission permission = new EventLogPermission(EventLogPermissionAccess.Administer, "."); permission.PermitOnly(); If I use the above statements before CreateEventSource when I go to...
2
by: Viza | last post by:
Can I get some suggestions on how I can tell if a user is logged in remotely on a Win XP Pro box and kill a certain process? Any solutions are welcome.
15
by: paul814 | last post by:
Is it possible to display the logged in user that is accessing the form, in a textbox? so say I have txtname I want to display the username of the person that is logged in to the PC in that...
5
by: TC | last post by:
Hey All, I'm trying to upload files via FTP and I'm using FtpWebRequest and WebClient. Unfortunately, I'm receiving a "Not Logged In" error. I know that others have seen this as I've seen...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.