Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Probs trying to use snmp to get info from printer

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 12-30-2006   #1 (permalink)
Eddy Steenbergen
Guest


 

Probs trying to use snmp to get info from printer

Hi. I am trying to use the get method of the com object "OlePrn.OleSNMP" to
get info from printers. The sequence I've used:
$a=new-object -comobject "OlePrn.OleSNMP"
$a.Open($IPAddressOfPrinter,"public",1,2000)
$v=$a.get(".1.3.6.1.2.1.1.4.0")
This should return the value of the contact. If I watch the net traffic I
see the correct response return from the printer. But in powershell I see
"Exception calling "Get" with "1" argument(s): "WinSNMP API Error: For
internal/undefined errors"
At line:1 char:7
+ $a.get( <<<< ".1.3.6.1.2.1.1.4.0")"
Can anyone suggest how I avoid this error and get the value returned by the
printer?
TIA
Eddy from Hobart in Tasmania in Australia.


My System SpecsSystem Spec
Old 12-31-2006   #2 (permalink)
marco.shaw@gmail.com
Guest


 

Re: Probs trying to use snmp to get info from printer

Try something like this instead:

$z=$a.open...
$v=$z.get...

Marco

My System SpecsSystem Spec
Old 01-01-2007   #3 (permalink)
Eddy Steenbergen
Guest


 

Re: Probs trying to use snmp to get info from printer

Tried that Marco but the $a.open does not return anything so I get "You
cannot call a method on a null-valued expression" from the $z.get.
Eddy

"marco.shaw@gmail.com" wrote:
> Try something like this instead:
>
> $z=$a.open...
> $v=$z.get...


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Powershell and SNMP CodeTestDummy PowerShell 9 05-12-2008 08:32 PM
Please wait while the printer sends info. to Windows Brian55 Vista print fax & scan 5 04-29-2008 12:06 PM
SNMP Community names on Vista Dee Vista installation & setup 2 02-03-2008 07:13 AM
Powershell use of SNMP WMI Provider OwenC PowerShell 2 06-02-2007 06:15 PM
Using PowerShell to get SNMP/Memory Usage data, is it possible? DreamweaverN PowerShell 1 10-30-2006 05:36 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51