473,320 Members | 1,987 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,320 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 1566

"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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.