Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 22-Feb-13 3:20am
Comments
Marcus Kramer at 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 at 22-Feb-13 9:54am
   
using win app in C#
CHITRAKSH 2010 at 22-Feb-13 9:58am
   
my purpose is to know detail of my office computers connected in LAN
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you want to know the workgroup computer name then code will be
 
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
 

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).
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 469
1 CHill60 465
2 OriginalGriff 325
3 PIEBALDconsult 285
4 BillWoodruff 193


Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100