WMIC

Afficher des informations d'un système Windows avec Windows Management Instrumentation Command-line (WMIC). WMIC peut fournir quantité d'informations d'un système Windows local ou distant.

WMIC is based on aliases. We can list the available aliases by using wmic /? help page:

> wmic /?

Below are some aliases we’re planning to use today:

  OS: Operating System.
  BIOS: BIOS management.
  CPU: Central Processing Unit.
  MEMPHYSICAL: Physical memory management.
  NIC: Network Interface Controller management.
  DISKDRIVE: Physical disk drive.
  USERACCOUNT: User accounts.

To get a brief overview of an alias, open CMD as Administrator and run:

> wmic <alias> list brief

Full alias overview can be displayed:

> wmic <alias> list full

Interactive mode is also available:

> wmic
wmic:root\cli>

Type quit to exit interactive mode. Get Information About Operating System

> wmic OS get Caption,CSDVersion,OSArchitecture,Version
Caption                                     CSDVersion      OSArchitecture  Version
Microsoft® Windows Server® 2008 Datacenter  Service Pack 2  64-bit          6.0.6002

Get Information About BIOS

> wmic BIOS get Manufacturer,Name,SMBIOSBIOSVersion,Version
Manufacturer  Name             SMBIOSBIOSVersion  Version
Xen           Revision: 1.221  3.4.3.amazon       Xen - 0

Get Information About CPU

> wmic CPU get Name,NumberOfCores,NumberOfLogicalProcessors
Name                                      NumberOfCores  NumberOfLogicalProcessors
Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz  2              2

Get the Amount of RAM Installed

> wmic MEMPHYSICAL get MaxCapacity
MaxCapacity
301989888

Get Memory Device DIMM Numbers

> wmic MEMORYCHIP get Capacity,DeviceLocator,PartNumber,Tag
Capacity    DeviceLocator  PartNumber         Tag
2147483648  DIMM_A2        HMT325R7BFR8A-H9   Physical Memory 1
2147483648  DIMM_A3        HMT325R7BFR8A-H9   Physical Memory 2
2147483648  DIMM_A5        HMT325R7BFR8A-H9   Physical Memory 4
2147483648  DIMM_A6        HMT325R7BFR8A-H9   Physical Memory 5
8589934592  DIMM_A8        9965516-099.A00LF  Physical Memory 7
8589934592  DIMM_A9        9965516-099.A00LF  Physical Memory 8
2147483648  DIMM_B2        HMT325R7BFR8A-H9   Physical Memory 10
2147483648  DIMM_B3        HMT325R7BFR8A-H9   Physical Memory 11
2147483648  DIMM_B5        HMT325R7BFR8A-H9   Physical Memory 13
2147483648  DIMM_B6        HMT325R7BFR8A-H9   Physical Memory 14
8589934592  DIMM_B8        9965516-099.A00LF  Physical Memory 16
8589934592  DIMM_B9        9965516-099.A00LF  Physical Memory 17

Get Information About NICs

> wmic NIC get Description,MACAddress,NetEnabled,Speed
Description                     MACAddress         NetEnabled  Speed
WAN Miniport (SSTP)
WAN Miniport (L2TP)
WAN Miniport (PPTP)             50:50:54:22:11:00
WAN Miniport (PPPOE)            33:50:6F:22:11:00
WAN Miniport (IPv6)
WAN Miniport (Network Monitor)
Microsoft ISATAP Adapter                                       100000
WAN Miniport (IP)
Microsoft Tun Miniport Adapter  02:00:54:22:11:00              1073741824
RedHat PV NIC Driver            02:9B:9F:22:11:00  TRUE        100000000
RAS Async Adapter               20:41:53:22:11:00

Contrôler les vitesses des cartes réseau actives

> wmic NIC where NetEnabled=true get Name, Speed

Get Information About Physical Drives

> wmic DISKDRIVE get InterfaceType,Name,Size,Status
InterfaceType  Name                Size          Status
SCSI           \\.\PHYSICALDRIVE0  85896599040   OK
SCSI           \\.\PHYSICALDRIVE1  107372805120  OK
SCSI           \\.\PHYSICALDRIVE2  10733990400   OK
SCSI           \\.\PHYSICALDRIVE3  85896599040   OK
SCSI           \\.\PHYSICALDRIVE4  85896599040   OK

Get Information About User Accounts

> wmic USERACCOUNT get Caption,Name,PasswordRequired,Status
Caption                     Name             PasswordRequired  Status
SERVER2008\administrator    administrator    TRUE              Degraded
SERVER2008\Guest            Guest            FALSE             Degraded
SERVER2008\sandy            sandy            TRUE              OK
SERVER2008\patrick          patrick          TRUE              OK

Get Serial Numbers of Hard Drives

> wmic path win32_physicalmedia get SerialNumber
SerialNumber
9RXFA3FG
Z2AP14Z2