r/PowerShell • u/zaphodikus • 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?
View all comments
Show parent comment
1
u/zaphodikus Apr 28 '26 edited Apr 28 '26
That is a clue at any rate, thanks. I do recall it being hard to initially get started, nobody documents their gotchas it seems.
How do I find a safe secure way to find this random binary on the web? What is Crescendo? Alternative to Praesler's or iReasoning's tool?
/edit I got something to respond in the end
I think i had to turn off "send trap" and change the access to "any host". https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-snmp-service Before I managed to get joy on a local connection, all I need is local anyway. Now I need a cuppa it's taken about 5 hours to get through firewalls, admin permissions and more.
If someone pings me again in a few days I'll share more script and steps in detail, as I will be more sure of what I did and what to still secure down. After this it's still linux/Ubuntu support and C++ instead. But do ping me later.