Wmi Query Printer Serial Number

The number of WMI properties that can be monitored has increased with every new version of Windows. Display the DELL Serial number (also works for some other brands). WMIC PRINTER where PortName='LPT1:' GET PortName, Name. On Windows 10, there could be a lot of reasons you may need to determine specific details (such as serial number, model, firmware version, etc.) about the hard drive on your computer.
System, BIOS, Motherboard
Thisfirst example shows a few variations of the most common WMI query. Weask a WMI object (computersystem, or bios, or baseboard in the examplesbelow) to return the values for a few of its properties. It returns theresults in its default tabular format.
C:Tools>wmic computersystem get domain, EnableDaylightSavingsTime, Manufacturer, Model, PartOfDomain, TotalPhysicalMemory, username C:Tools>wmic bios get Caption, Manufacturer, SMBIOSBIOSVersion, Version C:Tools>wmic baseboard get Manufacturer, Model, Product, SerialNumber, Version |
Processor Info
| C:Tools>wmic cpu get deviceID, Addresswidth, MaxClockSpeed, Name, Manufacturer, ProcessorID AddressWidth DeviceID Manufacturer MaxClockSpeed Name ProcessorId 32 CPU0 GenuineIntel 2992 Intel(R) Pentium(R) 4 CPU 3.00GHz BFEBFBFF00000F29 32 CPU1 GenuineIntel 2992 Intel(R) Pentium(R) 4 CPU 3.00GHz BFEBFBFF00000F29 |
Hard Drives
C:Tools>wmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size, volumeserialnumber |
The drivetypesare:
| Member name | Description | |
|---|---|---|
0 | Unknown | The type of drive is unknown. |
1 | NoRootDirectory | The drive does not have a root directory. |
2 | Removable | The drive is a removable storage device, such as a floppy disk drive or a USB flash drive. |
3 | Fixed | The drive is a fixed disk. |
4 | Network | The drive is a network drive. |
5 | CDRom | The drive is an optical disc device, such as a CD or DVD-ROM. |
6 This How-To Guide is the first of two documents that describe (in detail) this development process. This document looks at one of two options for enabling push scenarios. Part 1 deals with the creation of the Model Provider class, and part 2 will deal with the creation of the Runtime Data Provider class.This is the second of two How-To guides that shows how to develop a Gateway Service using the OData Channel approach.In some cases, business entity instances may logically belong together and need to be handled or processed together in the same logical unit of work. Look out for OData Channel Subscription Push How To guide coming soon.Writing a Gateway Service using the OData Channel requires an understanding of the relationship between your ABAP code and the generated OData XML. For example, on a sales order, an update of two or more related item entries could be required and must be processed together in a single request (all or none). Sap netweaver as implementation and operation pdf free. | Ram | The drive is a RAM disk. |
Here is a bonus: S.M.A.R.T. information!
| C:Tools>WMIC /NAMESPACE:rootwmi PATH MSStorageDriver_FailurePredictStatus get * /format:list Active=TRUE InstanceName=IDEDiskG.SKILL_128GB_SSD_______________________02.101044&8188e1b&0&0.0.0_0 PredictFailure=FALSE Reason=0 |
You can also experiment with
- MSStorageDriver_FailurePredictData
- MSStorageDriver_FailurePredictEvent
- MSStorageDriver_FailurePredictFunction
Memory
I can't really explain why the output below gives me more available virtual memory than total virtual memory.
| C:Tools>wmic memlogical get AvailableVirtualMemory, TotalPhysicalMemory, TotalVirtualMemory AvailableVirtualMemory TotalPhysicalMemory TotalVirtualMemory 2049300 2095848 1939180 |
NIC properties
In the first example below, I query for all NICs. Yikes, too much info!
Inthe second example I use a where IPEnabled='TRUE' clause to narrowthings down, but it's still too much. Here we have several IPEnableddevices which we don't really care about; the system runs VMware, has aTV card, and had a disabled 100bT NIC.
Inthe third example, I only care about the NIC that is enabled andconnected! Could have used DHCPEnabled as the second test, but we mightwant to get this info from systems with static IPs. I would havecompared the IPAddress value to good IPs (or eliminated 192.168 and169.* addresses), but sadly I have not figured out a way to do WHEREqueries on IPAddress; apparently the {} brackets indicate it is anarray value, and I have found no way to do WQL queries that comparearray values. Please use the comments link if you know how to do this!So, by adding the extra query condition (shown in red),I get only the currently 'live' connection. Although I can imaginecases where DNSDomain would be null and the NIC would still be the liveconnection. YMMV!
The final query gets a fair amount of NIC information in list format.
C:Tools>wmic nicconfig get caption, macaddress, ipaddress, DefaultIPGateway C:Tools>wmic nicconfig where 'IPEnabled = 'TRUE' get caption, macaddress, ipaddress, DefaultIPGateway C:Tools>wmic nicconfig where 'IPEnabled = 'TRUE' and DNSDomain IS NOT NULL' get caption, macaddress, ipaddress, DefaultIPGateway DefaultIPGateway={'10.0.0.10'} |
Video
Wwii ballistics armor and gunnery. C:Tools>wmicpath Win32_VideoController get caption, CurrentHorizontalResolution,CurrentVerticalResolution, Description, DriverVersion, AdapterRAM/format:list AdapterRAM=67108864 C:Tools> |
Printers
| C:Tools>wmic printer get Caption, Default, Direct, Description, Local, Shared, Sharename, Status Caption Default Description Direct Local Shared ShareName Status TPC PostScript HQ2K FALSE FALSE TRUE FALSE Unknown Microsoft XPS Document Writer FALSE FALSE TRUE FALSE Unknown Lexmark i3 TRUE FALSE TRUE TRUE Lexmark I3 Office Unknown hp photosmart 240 series FALSE FALSE TRUE TRUE PHOTO-printer Unknown hp officejet g series fax FALSE FALSE TRUE FALSE Unknown hp officejet g series FALSE FALSE TRUE TRUE hpoffice Unknown Adobe PDF FALSE FALSE TRUE FALSE Unknown Acrobat PDFWriter FALSE FALSE TRUE FALSE Unknown Acrobat Distiller FALSE FALSE TRUE FALSE Unknown |
Other Hardware
Here's a query that makes an output somewhat like Linux's lspci:
C:>wmic path Win32_PnPEntity where 'PNPDeviceID like '%VEN%' get PNPDeviceID, Status, Manufacturer, Service It's best to get Captionand PNPDeviceIDin your query, but that makes the output too wide for this web page. Sobelow I show getting the Caption rather than PNPDeviceID C:>wmic path Win32_PnPEntity where 'PNPDeviceID like '%VEN%' get Caption, Status, Manufacturer, Service Here'sa fun one. List the name and PCI ID of everything in Device managerthat is in an error state. You know, those little yellow exclamationpoints! C:Tools>wmic path win32_pnpentity where 'ConfigManagerErrorCode <> 0' get Name, PNPDeviceID |
Operating System, Service Pack, Hotfixes, Domain
Notice how I used the /format:list directive to return a list rather than a superwide table.
A QFE is a hotfix. In the first QFE query below, rather than a get verb, I used list brief.
Inthe second QFE query, note the use of the percent sign (%) as wildcardin a WHERE clause, highlighted in red. This is important to remember;WQL queries do not use the asterisk as a wildcard!
C:Tools>wmicos get bootdevice, caption, csname, currenttimezone, installdate,servicepackmajorversion, servicepackminorversion, systemdrive, version,windowsdirectory /format:list C:Tools>wmic qfe list brief C:Tools>wmic qfe where 'HotFixID like '%928366%'' get Description, FixComments, InstalledOn, ServicePackInEffect C:Tools>wmic ntdomain get Caption, DnsForestName, DomainControllerAddress, Status |
Services
C:Tools>wmic service get caption, name, state C:Tools>wmic service where 'name='Alerter' get caption, startmode, startname, state, status |
Installed Software
This notthe same as the 'currently installed programs' list you would get byopening Control Panel --> Add/Remove Software. I am not sure how orwhy the two lists are different, but on my test machine they aredefinitely not the same. NOTE: the 'wmic product' query doesn't work on Windows 2003 until you add the Windows Installer Provider, as illustrated here.
You can uninstall sofware, too.
| C:Tools>wmic product get Caption, InstallDate, Vendor Caption InstallDate Vendor ABBYY FineReader for ScanSnap (TM) 2.0 20070127 ABBYY Software VMware Server Console 20061106 VMware, Inc. MSXML 4.0 SP2 (KB925672) 20061012 Microsoft Corporation Intel(R) PROSafe for Wired Connections 20041226 Intel NETGEAR Wireless Adapter WG311T 20050415 NETGEAR Windows Server 2003 Administration Tools Pack 20031007 Microsoft Corporation VMware Workstation 20061228 VMware, Inc. Intel(R) PROSafe for Wired Connections 20041226 Intel HP Software Update 20050331 HEWLET~1 Hewlett-Packard Windows Resource Kit Tools 20030917 Microsoft Corporation [..listing truncated, you get the point..] H:>wmic path win32_product where 'name = 'HP Software Update' call Uninstall <--- UNINSTALLING software. Executing (COMPUTERrootcimv2:Win32_Product.IdentifyingNumber='{DEC61338-62B5-454A-AAB2- 71D612277798}',Name='HP Software Update',Version='1.5.0')->Uninstall() Method execution successful. Out Parameters: { ReturnValue = 0; <--- zero means success. The package was uninstalled. }; |
Processes
Here we use several call methods to actually do stuff (rather than just listing stuff). And we get a lot of fairly ugly and needless output. But the commands are useful just the same.C:Tools>wmic process call create 'notepad.exe' [..notepad starts in the GUI..]
C:Tools>wmic process where 'name='notepad.exe' get Caption, ExecutablePath, Priority, ProcessID, WorkingSetSize |
Event Logs
Note that these take a long time to complete- so long that the command is nearly useless. I could have included theeventlog message below (it's 'Message'), but that would have made theoutput way too wide for this web page. The query shown below gets all warning and error log entries from System which occurred after December 4, 2007.
H:>WMICNTEVENT WHERE 'EventType<3 AND LogFile = 'System' ANDTimeGenerated>'20071204' GET EventCode, EventIdentifier,RecordNumber, SourceName, TimeGenerated, Type |
Users and Groups
C:Tools>wmic useraccount where 'LocalAccount='TRUE' get Caption, Disabled, Domain, Lockout, PasswordExpires, SID, Status C:Tools>wmic group where 'LocalAccount='TRUE' get Caption, SID, Status |
You could use WMIC to get members of a group, like so:
wmic group where 'Name='Administrators' assoc /resultclass:Win32_useraccount
..but the result is so ugly, it's not worth the bother. There are better ways to do that sort of query. Hint: NET LOCALGROUP Administrators
Query remote hosts
/node specifies the remote host name. The rest seems self-explanatory.
C:Tools>wmic /node:fs1 /user:mydomainquuxadmin /password:mypass logicaldisk where drivetype=3 get name, freespace, filesystem, size |