473,396 Members | 1,789 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
Jul 21 '05 #1
1 1568

"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.
Jul 21 '05 #2

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

Similar topics

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...
2
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.