

PrinterStatus.PrinterStatus = " PRINTER_READY" Int statuscode = 10 * Convert.ToInt32(printerStatus.DeviceStatus) + Convert.ToInt32(printerStatus.PrinterStatus) new Variable(new ObjectIdentifier(errrorStateOID)), //not working // new Variable(new ObjectIdentifier(jobNameOID)), //not working // new Variable(new ObjectIdentifier(alertDescOID)) //not workingĭeviceStatus = (), Since WMI is being depreciated, I will use CIM in powershell: Get-CIMInstance CIMPrinter Format-Table Name,SystemName,ShareName >printers.txt. New Variable( new ObjectIdentifier(totalPageCountOID)) New Variable( new ObjectIdentifier(printerStatusOID)), New Variable( new ObjectIdentifier(deviceStatusOID)), New IPEndPoint(IPAddress.Parse(printerIP), 161),

Var result = Messenger.Get(VersionCode.V1, This will list the printers and show it in the Command Prompt. We can print the computer name using this environment variable as follows. Now, type wmic printer list brief command and press Enter. Type cmd and press Ctrl + Shift + Enter to open an elevated Command Prompt.
#Wmic printer get systemname windows
String totalPageCountOID = " 1.3.6.1.2.1.43.10.2.1.5.1.1" To use the wmic command line in Command Prompt, follow the steps given below: Press Windows + R keys to launch the Run utility. WMIC /NODE:SERVERNAME CPU GET NAME Additional Resources WMIC Take Command-line Control over WMI Security with WMIC WMIC verbs -Blake Morrison 3 Likes. String printerStatusOID = " 1.3.6.1.2.1.25.3.5.1.1.1" printer get DeviceID, DriverName, Hidden, Name, PortName, PowerManagementSupported, PrintJobDataType, VerticalResolution, Horizontalresolution. WIN32printer CLASS with PaperSizesSupported, is what you need.

Look it up, or manually scower through the repos using wbemtest. Also, there are probably custom WMI Classes that are specific to your printer that you may be able to use. Static string printerIP = " 10.28.40.80" // PBA01 - laser printer static PrinterStatusObj printerStatus = new PrinterStatusObj() Ĭonsole.WriteLine( " printer status is: " + printerStatus.PrinterStatus) Ĭonsole.WriteLine( " total page count is is: " + printerStatus.TotalPageCount) if you run a wmi query against a remote computer with your admin account, you wont be able to see those printers.
#Wmic printer get systemname free
free snmp library from codeplex using
