|
-
Oct 9th, 2006, 07:16 PM
#1
Thread Starter
Banned
Getting a list of pcs on a network
Hi,
How can I get the names of PCs on my network using c#? Any help woud be appreciated?.
Thanks.
-
Oct 9th, 2006, 07:21 PM
#2
Re: Getting a list of pcs on a network
-
Oct 10th, 2006, 02:26 PM
#3
Re: Getting a list of pcs on a network
Two ways jump to mind - WMI or Active Directory (AD stores all computers joined to the domain, of course).
Apparently this book has a nice section on WMI: http://www.amazon.co.uk/exec/obidos/.../wwwxamlnet-21
Something to note though - you must have appropriate rights on each PC to query the WMI interface...
As for AD - the LDAP query would be: "(objectClass=computer)". You will, of course, need a domain controller to connect to, and appropriate rights to query AD.
-
Oct 11th, 2006, 02:30 PM
#4
Thread Starter
Banned
Re: Getting a list of pcs on a network
Thanks guys!.
jmcilhinney, I have managed to implement that code even though I don't really understand it?.. and axion_sa, I was actually looking to use Wmi in other parts of the program but was unaware that I could retrieve PC names using WMI. How is this possible?.
Thanls.
-
Oct 11th, 2006, 05:52 PM
#5
Re: Getting a list of pcs on a network
Check out gigemboy's signature for some WMI links. He's wrapped up a lot of WMI classes all into one place. WMI is used through the System.Management namespace. For a list of all available WMI classes and their members go here. It's the Win32 classes that you'll be most interested in. For more information on using WMI in .NET go here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|