• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
We have new content about printers, Click here to check it out!
HP Recommended
SNMPWALK
Microsoft Windows Server 2016

I'm hoping someone can help, but basically I just want to query a printer's Asset Number with SNMP. However, when doing an SNMPWALK to view all of the OID values, none of the returned values match the asset number set on the printer. I tried converting the decimal-form of the asset number to hex and binary, then searching for those, but not getting anything.


The 3 printers I'm testing with are:

HP Color LaserJet M750

HP Color LaserJet FlowMFP M681

HP LaserJet P3015

 

I am scripting as much as possible when setting up new printers. If I could get the asset number, that would help me greatly. I am successfully getting model name and host name from the printers with an SNMP GET Powershell object, but can't find an OID that contains the asset number. Is it somehow not accessible via an OID and SNMP? Is it encrypted or something and I can decrypt it somehow?

 

One website says it should be OID .1.3.6.1.4.1.11.2.3.9.4.2.1.1.3.12.  When I search for that, I see:

 

OID=.1.3.6.1.4.1.11.2.3.9.4.2.1.1.3.12.0, Type=OctetString, Value= FD E8 35 39 31 33 36 38

 

The decimal form of the Asset Number is:  591368


I also tried "octal to text" conversion, it returns weird characters that aren't actual text...

I also tried decimal to octal (base 😎 but that number wasn't found in the SNMPWALK results either.

 

Can anyone see a correlation between the two? Or perhaps someone knows how to get the Asset Number from the printer another way that I can do in Powershell?

 

Thanks!

~Mike

1 ACCEPTED SOLUTION

Accepted Solutions
HP Recommended

Your asset number, 591368, is in there:

 

Value= FD E8 35  39  31  33  36  38

 

Don't know why it's mixed in...

If my post resolves your issue please click the accepted as solution button under it.


To thank a Tech for a post click the thumbs up button under the post.


You can even click both buttons. . .

View solution in original post

3 REPLIES 3
HP Recommended

Your asset number, 591368, is in there:

 

Value= FD E8 35  39  31  33  36  38

 

Don't know why it's mixed in...

If my post resolves your issue please click the accepted as solution button under it.


To thank a Tech for a post click the thumbs up button under the post.


You can even click both buttons. . .
HP Recommended

You just blew my mind....haha!

HP Recommended
For anyone interested in how I'm doing SNMP in PowerShell, here is the gist of it:
 
$IP = [IP of printer]
$SNMP = New-Object -ComObject olePrn.OleSNMP      
$SNMP.open($IP,'yourcommunityname',2,1000)          # Open the SNMP connection with 2 = attempts, 1000 = timeout in ms
$assetFromSnmp = $SNMP.get('.1.3.6.1.4.1.11.2.3.9.4.2.1.1.3.12.0')       # Returns a value like ye591368, but the "ye" part has an accent over the e and stuff that I needed to get rid of
$asset = $assetFromSnmp -replace "[^0-9]"      # Gets rid of the "ye" part or anything that isn't a number
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.