Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Everyone!

I want the details of currently online systems in a network using c#. Our machines connected through Windows Server 2012. How to achieve this goal ? someone guide if I am wrong? This program going to run on Server machine.
Posted
Updated 31-Jul-15 1:15am
v2
Comments
John C Rayan 31-Jul-15 7:04am    
Need more info.
Sarath kumar.N 31-Jul-15 7:06am    
One winForm application running in windows server machine. That will collect the currently connected user with server. That application looks for change at every 2 mins.
John C Rayan 31-Jul-15 7:14am    
Are you saying that you are trying to collect the user details who are connected to the server? I am not sure I understood you entirely.
Sarath kumar.N 31-Jul-15 7:18am    
Yeah, I want know how many systems current online? If online who is the current user?

1 solution

This could be easy or significantly time consuming based on whether you are writing an enterprise application or something just for your use.

There are monitoring solutions available like SCOM which can discover and collect information from various machines.

If you are writing your own app then you should think of certain things:

1. Authentication
2. Communication (agentless or agent based and, protocol WMI/Powershell/etc.)

For a small application, I'd suggest using remote powershell. The following link has a powershell script for getting logged on user information from machine.

https://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c[^]
 
Share this answer
 
Comments
Sarath kumar.N 31-Jul-15 7:22am    
This application for an company. they own more than 1000 systems. If I got the results from power shell script how can I use that in my app? pls suggest
himanshu agarwal 31-Jul-15 7:36am    
Just call this script from your application.

You may refer to these posts for sample code.

http://stackoverflow.com/questions/527513/execute-powershell-script-from-c-sharp-with-commandline-arguments

http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
Sarath kumar.N 31-Jul-15 7:43am    
You mentioned a script from Microsoft. I tried to run that. But that is not showing anything. Scripts automatically closing after open.
himanshu agarwal 1-Aug-15 5:25am    
you may have to read the documentation or tweak it as per your need.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900