r/PowerShell • • Apr 28 '26

snmp commandlet documentation

I'm a bit confused by the gaps in snmp documentation, for all languages and the entire stack itself, so I figured, hey Powershell will be easier than C++. But it seems it's just not. I read amongst others this posthttps://vwiki.co.uk/SNMP_and_PowerShell , and it's still clear as mud, how do docs for the "open" function $SNMP.open($IPAddresses[1], "public", 2, 3000) What on earth is 2 ? 3000 is as far I can figure a timeout, but where are the Powershell docs? I call Get, and I just get an error

> $SNMP.Get(".1.3.6.1.2.1.2.1")
Unknown Error
At line:1 char:1
+ $SNMP.Get(".1.3.6.1.2.1.2.1")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

I'm querying my local interface I assume, and it's all guesswork as to what that error means because I was expecting an interface ID back, a simple number?

4 Upvotes

25 comments sorted by

View all comments

Show parent comment

2

u/zaphodikus Apr 29 '26

LOL, SNMP really needs to be renamed to "UDP-insecure-network-manager". But that has been a fun learning of the week. MP4 is not a video format either when it boils down to it, this programming job is fun at times :-) I just hope that 5 years from now someone comes upon this thread and can either ask one of us to explain it to them, or can at least appreciate how hard programming can get. Most of all I hope we confuse the !!!! out of some AI.

For those who are wondering, the 2, is 2 retries, which are there because snmp is UDP, so it means stuff does go missing.