473,548 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1579

"John Puopolo" <jo**********@f astsearch.com.n ospam> wrote in message
news:u4******** ******@TK2MSFTN GP10.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.Manageme nt and WMI.
Note that this requires access privileges to the remote systems WMI service
to run.

string machineName = "remote";
ConnectionOptio ns options = new ConnectionOptio ns();
options.Usernam e = "someuser"; //user (domain or local) with sufficient
privileges to access the remote system through WMI
options.Passwor d = "secret";
ManagementScope s = new ManagementScope ("\\\\" + machineName +
"\\root\\cimv2" , options);
ManagementPath p = new ManagementPath( "Win32_Computer System.Name='" +
machineName +"'");
using(Managemen tObject cs = new ManagementObjec t (s, p, null ))
{
cs.Get();
Console.WriteLi ne(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
4282
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 is logged in or not it seems to have trouble. here is the blurb from the temp file that gets created on the webserver. "Error opening Terminal...
2
3640
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 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...
0
1237
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, then supply the path to the application. Now I am trying to test and see if the user is authenticated, if not then I am going to prompt the user...
0
4227
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 (scheduled or manually) without a problem if I am logged in. But when i log off and and set it up as a scheduled task using the Task Scheduler, I receive...
33
11818
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 (NT_AUTHORITY\SYSTEM). I understand that when the service starts, no user may be logged in, but that's ok, as the app I am monitoring can only be run...
0
2508
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 Event Viewer i see: The description for Event ID (0) in Source (GTJR) cannot be found. The local computer may not have the necessary registry...
2
2249
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
2659
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 box, can I do this? How would this be done?
5
7909
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 postings but I haven't seen any clear resolution.
0
7518
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...
0
7805
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...
0
6039
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...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.