Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2004-11-02
Medium Priority
Last Modified: 2008-01-09
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)
Question by:gav_jackson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 22

Expert Comment

ID: 12485180

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

Author Comment

ID: 12491042

Accepted Solution

PashaMod earned 0 total points
ID: 12494475
Closed, 155 points refunded.
Community Support Moderator

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question