WMIC examples

This site requires Javascript

You are seeing this if you have Javascript disabled.

WMIC is a command-line utility for interacting with Windows Management Instrumentation.

Get list all of aliases

wmic alias list brief

Get BIOS serial number

wmic bios get serialnumber

Get OS name

wmic os get name

wmic PATH Win32_OperatingSystem GET name

Get OS Install Date

wmic PATH Win32_ComputerSystem GET InstallDate

Get CPU name

wmic cpu get name

wmic PATH Win32_Processor get Name

Get TPM information

wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get ManufacturerIdTxt,ManufacturerVersion,SpecVersion

Get GPU description

wmic PATH win32_videocontroller GET description

Get HDD info

wmic diskdrive get model,name,size

wmic path win32_LogicalDisk get model,name,size

Get network devices and details

wmic nic get name,index,netenabled,physicaladapter

wmic path Win32_NetworkAdapter get Name,MACAddress,NetConnectionStatus,NetEnabled,PhysicalAdapter

Enable/disable NIC based on index

wmic path win32_networkadapter where index={:Integer:} call enable

wmic path win32_networkadapter where index={:Integer:} call disable

Enable/disable all physical NICs

wmic path win32_networkadapter where physicaladapter=TRUE call enable

wmic path win32_networkadapter where physicaladapter=TRUE call disable

Get list of printers

wmic printer list status

Get list of users and SIDs

wmic useraccount get name,sid

wmic path Win32_UserAccount get name,sid

Set user passwords to not expire

wmic path Win32_UserAccount set PasswordExpires=False

wmic path Win32_UserAccount where "name='{:Username:}'" set PasswordExpires=False

wmic path Win32_UserAccount where "LocalAccount=TRUE" set PasswordExpires=False

Get list of installed applications

wmic product get name,vendor,version

Uninstall an application

wmic product where "name='{:SoftwareName:}'" call uninstall

View all services

wmic path Win32_Service get DisplayName,Name,Status,StartMode,Started

Search for service

wmic path Win32_Service where "name='{:ServiceName:}'" get DisplayName,Name,Status,StartMode,Started

Search for all automatic services which are not currently started

wmic path Win32_Service where (Started=FALSE and StartMode='Auto') get DisplayName,Name,Status,StartMode,Started

Run query against another machine (RPC server must be available)

wmic /NODE:"{:MachineName:}"

wmic /NODE:"{:MachineName:}" /USER:"{:Domain:}\{:Username:}"

wmic /NODE:"{:MachineName:}" /USER:"{:Domain:}\{:Username:}" /PASSWORD:"{:Password:}"

Tags: #Os #Windows #Wmi