WMI and WMIC example text for common queries

This is straight from the Microsoft Technet July 2005 CD set.  I’ve not seen it elsewhere, and since I’ve found it so useful, I’m going to repost it here.  WMIC is the command line interface to WMI.  Using the WMIC alias makes it easier to return computer information, all from a command line.


The following table contains example text of common queries using WMIC Aliases.  To run one of the queries, cut the entire contents of a cell in the Example Text column, paste at the WMIC command prompt, edit the variables as appropriate, and press the ENTER key.

 

Alias Example text (includes variables)
ALIAS ALIAS GET FriendlyName,PWhere,Target
BASEBOARD BASEBOARD GET Product,Manufacturer
BIOS BIOS GET Manufacturer,Name,ReleaseDate,SMBIOSBIOSVersion
BOOTCONFIG BOOTCONFIG GET BootDirectory,Description
CDROM CDROM GET Drive,MediaLoaded,Name,Size,SystemName,VolumeName
COMPUTERSYSTEM COMPUTERSYSTEM GET Domain,Manufacturer,Model,Name,PrimaryOwnerName
CPU CPU GET CurrentClockSpeed,DeviceID,ExtClock,MaxClockSpeed,L2CacheSize,Caption
CSPRODUCT CSPRODUCT GET Name,Vendor
DATAFILE DATAFILE WHERE “Extension=’ini’ and path=’\\’” GET Name,LastModified
DATAFILE DATAFILE WHERE “Path=’\\windows\\system32\\wbem’ AND Extension=’dll’  GET Name,LastModified
DCOMAPP DCOMAPP GET AppID,Name
DESKTOP  
DESKTOPMONITOR DESKTOPMONITOR WHERE Availability=’3′ GET ScreenHeight,ScreenWidth,PNPDeviceID
DEVICEMEMORYADDRESS DEVICEMEMORYADDRESS GET CSName,Name,StartingAddress,EndingAddress
DISKDRIVE DISKDRIVE GET InterfaceType,Model,Partitions,Size,SystemName,Model,Name
DISKQUOTA DISKQUOTA WHERE “lIMIT>’100000’”
DMACHANNEL DMACHANNEL LIST
ENVIRONMENT ENVIRONMENT WHERE “Username=’<SYSTEM>’” GET Name, VariableValue,Name
FSDIR FSDIR WHERE “Path=’\\Windows\\’” GET CSName,Compressed,EightDotThreeFilename,Filename
GROUP GROUP WHERE “Name=’Domain Users’”
IDECONTROLLER IDECONTROLLER GET Manufacturer,Name,Status,SystemName
IRQ IRQ GET CSName,Name,Status,IRQNumber
JOB JOB GET Command,RunRepeatedly,StartTime
LOADORDER LOADORDER GET Name,GroupOrder /format:csv:”sortby=GroupOrder”
LOGICALDISK LOGICALDISK WHERE “DriveType=’3’ OR DriveType=’4’” GET Caption
LOGON LOGON GET AuthenticationPackage,LogonID,LogonType,StartTime
MEMCACHE MEMCACHE GET InstalledSize,CacheType,SystemName
MEMLOGICAL MEMLOGICAL GET TotalPageFileSpace,TotalPhysicalMemory
MEMORYCHIP MEMORYCHIP GET Capacity,DeviceLocator,MemoryType
MEMPHYSICAL MEMPHYSICAL GET MaxCapacity,MemoryDevices
NETCLIENT NETCLIENT GET Name,Status
NETLOGIN NETLOGIN GET PasswordExpires,Name,NumberOfLogons,ScriptPath,LogonServer
NETPROTOCOL NETPROTOCOL GET Name,Status,SupportsBroadcasting
NETUSE NETUSE GET Name,Status,UserName
NIC NIC GET AdapterType,Caption,MACAddress,NetconnectionStatus,ServiceName,MACAddress
NICCONFIG NICCONFIG WHERE MACAddress!=NULL GET Caption,DefaultIPGateway,DHCPServer,DNSHostName,DNSServerSearchOrder
NICCONFIG NICCONFIG WHERE Index=1 CALL EnableDHCP
NTDOMAIN NTDOMAIN GET Description,DnsForestName,DomainControllerAddress
NTEVENT  
NTEVENTLOG NETEVENTLOG GET FileSize,MaxFileSize,LogFileName,OverWritePolicy
ONBOARDDEVICE ONBOARDDEVICE GET Description,Enabled
OS OS GET CSName,CSDVersion,OSType,Version,NumberOfUsers,Caption,CurrentTimeZone
PAGEFILE PAGEFILE GET AllocatedBaseSize,CurrentUsage,Name,PeakUsage
PAGEFILESET PAGEFILESET WHERE Name=”C:\\pagefile.sys” SET InitialSize=5000
PARTITION PARTITION GET DeviceID,BootPartition,Size,StartingOffset,SystemName,Size
PORT PORT GET CSName,Description,EndingAddress,StartingAddress
PORTCONNECTOR PORTCONNECTOR GET PortType,InternalReferenceDesignator
PRINTER PRINTER GET DeviceID,Location,ShareName,Status,SystemName
PRINTERCONFIG PRINTERCONFIG GET Color,Name,PaperSize,PrintQuality,XResolution,YResolution
PRINTJOB PRINTJOB GET Document,Name,Owner,PagesPrinted,Status
PROCESS PROCESS WHERE NAME=”calc.exe” CALL Terminate
PROCESS PROCESS WHERE “WorkingSetSize>’1000000’* GET Caption,CSName
PRODUCT PRODUCT GET Name,Version,InstallDate
QFE QFE GET CSName,Description,HotFixID,InstallDate,InstalledBy
QUOTASETTING QUOTASETTING LIST
RDACCOUNT RDACCOUNT GET AccountName,PermissionsAllowed,PermissionsDenied,SID
RDNIC RDNIC GET NetWorkAdapterName,TerminalName
RDPERMISSIONS RDPERMISSIONS LIST
RDTOGGLE RDTOGGLE /NODE:”computer1” RDTOGGLE WHERE “AllowTSConnections=’1’”
RECOVEROS RECOVEROS GET AutoReboot,DebugFilePath,KernelDumpOnly
REGISTRY REGISTRY GET CurrentSize,MaxinumSize,Status /FORMAT:CSV
SCSICONTROLLER SCSICONTROLLER GET DriverName,Manufacturer,Name,Status
SERVER SERVER
SERVICE SERVICE WHERE Caption=”Telephony” CALL ChangeStartMode “Manual”
SERVICE SERVICE GET Name,DisplayName,ProcessID,Started,StartMode
SHARE SHARE GET Description,Name,Path /FORMAT:CSV
SOFTWAREELEMENT SOFTWAREELEMENT GET Description,InstallDate,Version
SOFTWAREFEATURE SOFTWAREFEATURE GET Caption,Description,LastUse,Name
SOUNDDEV SOUNDDEV GET Manufacturer,Name,Status,SystemName
STARTUP STARTUP GET Command,Description,Location,User
SYSACCOUNT SYSACCOUNT GET Domain,Name,SID
SYSDRIVER SYSDRIVER WHERE StartMode!=’Disabled’ GET DisplayName,PathName,Status
SYSTEMENCLOSURE SYSTEMENCLOSURE GET ChassisTypes,LockPresent,Manufacturer,SerialNumber
SYSTEMSLOT SYSTEMSLOT GET ConnectorType,Shared,SlotDesignation,Status
TAPEDRIVE TAPEDRIVE GET Compression,Description,Name,Status
TEMPERATURE TEMPERATURE GET CurrentReading,Description,MaxReadable
TIMEZONE TIMEZONE GET Bias,DaylightBias,StandardName
UPS UPS GET FirstMessageDelay,LowBatterySignal,MessageInterval
USERACCOUNT USERACCOUNT WHERE “Name=’username’ AND Domain=’domain’”
VOLTAGE VOLTAGE GET Accuracy,CurrentReading,Description,MaxReadAble
VOLUMEQUOTASETTING VOLUMEQUOTASETTING LIST
WMISET WMISET GET BuildVersion,LoggingDirectory,LoggingLevel,MaxLogFileSize