• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1234
  • Last Modified:

c# WMI SNMP retrieve network printers, switches, unix?

I know how to use WMI to query the various Win32_xxxx classes out there and retrieve information from windows OS machines, and i *think* it's possible to query SNMP in a similar way to retrieve information about various SNMP enabled devices on a network, such as printers and switches and possibly even unix machines.

I've been searching around on the internet but cannot find any information on how to achieve this, does anyone know?

sample code would be much appreicated, cheers.

(i'll offer all my remaining points on this one, although i know its not really enough - soz)
  • 2
1 Solution

keep your points and request that this question be deleted.

.NET does not have any native classes or namespaces that allows you to access SNMP directly (the system.Management class only uses WMI).  Go to microsoft.com and query SNMP there.  They have some tutorials and such, but it's all for C++.

The problem with SNMP is that it requires DCOM objects, which are basically distributed DLLs.  You can try to use DLLImport("snmp32.dll") and then create your own wrappers, but SNMP DLLS have their own memory management and what not, so even those most basic queries (get IP Address) requires a lot of effort.

In short, if you really want to do SNMP, use C++ or hope that MS includes SNMP in .net 2.0
gav_jacksonAuthor Commented:
Closed, 155 points refunded.
Community Support Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now