Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get detail of a remote computer if i know its IP address.

I am able to know computer name using GetHostEntry() method of system.net class by passing IP address of a remote computer


but i need to know more detail of a remote computer like OS name, OS version, UserNames etc

Please give some C# code which do NOT include "SELECT * FROM Win32_OperatingSystem" like program.

I like to know a win32 API for that if possible.
Posted
Comments
fjdiewornncalwe 22-Feb-13 9:27am    
1) Are you trying to get this information via web app, win app?
a) As a web app, you won't get that kind of information as browser security won't allow that.(Caveat is ActiveX)
b) As a win app, you will still need to have either your application, or a service of some kind running on the client machine in order to get that data.
If you are trying to do this without the client machine's knowledge, then you are wandering dangerously close to writing a malevolent application.
CHITRAKSH 2010 22-Feb-13 9:54am    
using win app in C#
CHITRAKSH 2010 22-Feb-13 9:58am    
my purpose is to know detail of my office computers connected in LAN

You discounted the only way you're going to get this information. You have to use WMI for this and need a user account that has permissions on the target machine to read this information.
 
Share this answer
 
If you want to know the workgroup computer name then code will be

C#
var de = new DirectoryEntry("WinNT://" + workgroupName);          
foreach (DirectoryEntry c in de.Children)
{
   Console.WriteLine(c.Name);
}


If you want to know the list of domain computer name then it will be


C#
var de = new DirectoryEntry("LDAP://" + domainName);           
de.Children.SchemaFilter.Add("computer");
foreach (DirectoryEntry c in de.Children)
{
     Console.WriteLine(c.Name);
}


Just you need to take reference of System.DirectoryServices component from GAC(framework dll).
 
Share this answer
 

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