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

Posted on 2004-11-02
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
    LVL 23

    Expert Comment


    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 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
    LVL 1

    Author Comment

    LVL 1

    Author Comment


    Accepted Solution

    Closed, 155 points refunded.
    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    860 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now