Difference between revisions of "Talk:SNMP and PowerShell"

Jump to navigation Jump to search
The SNMP.PS1 download is the same file as seen in the example under the name SNMP-Funcs.ps1
(SNMP & Powershell - example script question.)
 
(The SNMP.PS1 download is the same file as seen in the example under the name SNMP-Funcs.ps1)
Line 1: Line 1:
Question:
Hi there,
Hi there,


Line 12: Line 14:


I.
I.
----
Response:
OK, I realize no one has responded in a year, but perhaps someone will find this info useful...
The author is just using a different file name called '. .\lib\SNMP-Funcs.ps1' in his example.
It is the same as 'SNMP.ps1'
In the example below, BigDipper is my 'scripts' folder. I have a sub-folder under it called 'lib' with
SNMP.ps1 in it and a sub-folder under 'lib' called 'LexTmSharpSNMP' with 'SharpSnmpLib.dll' in it:
.\lib\snmp.ps1
.\lib\LexTmSharpSNMP\SharpSnmpLib.dll
Example:
PS C:\users\tyson\Downloads\snmp\PowerShell\BigDipper> . .\lib\SNMP.ps1
PS C:\users\tyson\Downloads\snmp\PowerShell\BigDipper> Load-SnmpAssembly | fl
CodeBase              : file:///C:/users/tyson/Downloads/snmp/PowerShell/BigDipper/lib/LexTmSharpSNMP/SharpSnmpLib.dll
EntryPoint            :
EscapedCodeBase        : file:///C:/users/tyson/Downloads/snmp/PowerShell/BigDipper/lib/LexTmSharpSNMP/SharpSnmpLib.dll
FullName              : SharpSnmpLib, Version=7.5.10510.1, Culture=neutral, PublicKeyToken=db32884da8b9d0dd
GlobalAssemblyCache    : False
HostContext            : 0
ImageFileMachine      :
ImageRuntimeVersion    : v2.0.50727
Location              : C:\users\tyson\Downloads\snmp\PowerShell\BigDipper\lib\LexTmSharpSNMP\SharpSnmpLib.dll
ManifestModule        : SharpSnmpLib.dll
MetadataToken          :
PortableExecutableKind :
ReflectionOnly        : False
PS C:\users\tyson\Downloads\snmp\PowerShell\BigDipper> Invoke-SNMPget "192.168.1.154" ".1.3.6.1.4.1.318.1.1.4.4.2.1.3.1"
OID                                                        Data
---                                                        ----
.1.3.6.1.4.1.318.1.1.4.4.2.1.3.1                            1
PS C:\users\tyson\Downloads\snmp\PowerShell\BigDipper>
The Wiki is pulling all my spaces out of the output between the final OID and the Data fields.
It's returning:
OID = .1.3.6.1.4.1.318.1.1.4.4.2.1.3.1
Data = 1
4

edits

Navigation menu