So, making good headway with the script today. I've decided to scrap the 'MODEL' part of the INI file and have now implemented a nifty bit of code that reads the model of the machine from the very first OID on the device. I've had to rename each section of the INI file to exactly match what comes back in the first OID on each device though.

Here's a couple of examples of what you get back from the first OID:

 Code:
.1.3.6.1.2.1.1.1.0,OctetString,Xerox Phaser 3320;Sys SW Version Phaser3320_V53.005.00.000 MAY-16-2014,MCB V2.50.04.00 MAY-16-2014,NIC V4.04.00,IOT V1.00.33,PCL5e 6.50.02.03,PCL6 6.23.00.02,PS 2.83.00.59.00.59 ,IBM/EPSON 5.29.01, IP Core 6.8.P


and

 Code:
.1.3.6.1.2.1.1.1.0,OctetString,Xerox WorkCentre 7835 v1 Multifunction System; System Software 071.010.103.04401, ESS 071.013.04411


for two different models. Just came up with this bit of code:

 Code:
$Cmd = 'snmpget.exe -r:' + $PrinterIP + ' -o:.1.3.6.1.2.1.1.1.0 -q'
$CmdResult = WshPipe($Cmd)
$CmdResult = Join($CmdResult[0], @CRLF)
$PModel = SubStr($CmdResult, Instr($CmdResult, "X"), (Instr($CmdResult, ";") - Instr($CmdResult, "X")))


which does the job nicely of populating the $PModel variable and that can then be used to find the right section of the INI (with the ReadProfileString function).

All looking great so far.

My only issue is that I am really going to have to create a data file containing a list of all the IPs of the printers we have and it'll cycle through this file querying each printer in turn. Bit annoying but I don't see any other way of doing it unless we change our system of not publishing printers in the directory.