top of page
  • Writer's pictureshishir kushawaha

Exploring the Power of WMI Classes: Top 20 Useful Classes with Example

When it comes to managing and gathering information from Windows systems, Windows Management Instrumentation (WMI) is a powerful technology that provides a standardized way to access and interact with various aspects of the operating system. In this blog post, we will explore 20 of the most useful WMI classes and provide practical examples of how they can be leveraged using PowerShell.

1. Win32_Process : Retrieves information about running processes on a Windows system.

Get-WmiObject -Class Win32_Process | Select-Object Name, ProcessId

2. Win32_Service : Manages system services, such as starting, stopping, and querying their status.

$serviceName = "Wsearch" 
$service = Get-WmiObject -Class Win32_Service -Filter "Name='$serviceName'"
$service.StartService() 

3. Win32_ComputerSystem : Provides information about the computer system, such as its name, domain, and hardware details.

$computerSystem = Get-WmiObject -Class Win32_ComputerSystem  | Select-Object Name, Manufacturer, Model, BootupState, SystemType, CurrentTimeZone, PCSystemType

4. Win32_LogicalDisk : Retrieves information about logical disks (e.g., hard drives) on the system.

Get-WmiObject -Class Win32_LogicalDisk  | Select-Object DeviceID, FreeSpace, Size 

5. Win32_NetworkAdapter : Provides information about network adapters available on the system.

Get-WmiObject -Class Win32_NetworkAdapter  | Select-Object ProductName, MACAddress, Manufacutrer,Description, NetConnectionID, NetConnectionStatus

Additionally you can use Win32_NetworkAdapterConfiguration to get its configuration details.

Get-WmiObject Win32_NetworkAdapterConfiguration | Select Caption, DHCPServer, DNSDomain, DNSHostname, Index, IPAddress, IPSubnet,MACAddress, DNSDomainSuffixSearchOrder, DefaultIPGateway

6. Win32_Processor : Retrieves information about the computer's processors, such as their speed and architecture.

Get-WmiObject -Class Win32_Processor | Select-Object Name, DeviceID,Manufacturer, NumberOfCores, MaxClockSpeed, L3CacheSize

7. Win32_BIOS : Retrieves information about the computer's BIOS (Basic Input/Output System).

Get-WmiObject -Class Win32_BIOS | Select-Object SMBIOSBIOSVersion, ReleaseDate, Manufacturer,SerialNumber,Version,BiosVersion

8. Win32_Product : Manages installed software on the system.

$productName = "webex" 
$app=Get-WmiObject -Class Win32_Product -Filter "Name='$productName'" 
$app.uninstall()

9. Win32_OperatingSystem: Provides information about the operating system installed on the computer.

Get-WmiObject -Class Win32_OperatingSystem | Select-Object Caption, Version, InstallDate,BuildNumber,CurrentTimeZone,EncryptionLevel,LastBootupTime,MUILanguages,OSArchitecture,SystemDrive

10. Win32_Printer : Manages printers installed on the system.

Get-WmiObject -Class Win32_Printer | Select-Object Name,Status,Default,DeviceID,DriverVersion, PrinterStatus,PrinterState,ShareName

11. Win32_UserAccount : Retrieves information about user accounts on the system.

Get-WmiObject -Class Win32_UserAccount | Select-Object Name 

12. Win32_NetworkAdapterConfiguration : Manages network adapter configurations, including IP addresses and DNS settings.

Get-WmiObject -Class Win32_NetworkAdapterConfiguration  | Select-Object  Caption, IPAddress, DHCPServer, IPSubnet, MACAddress

13. Win32_Share : Manages shared resources on the system, such as folders and printers.

Get-WmiObject -Class Win32_Share | Select-Object Name,Path,Description

14. Win32_Group : Retrieves information about user groups on the system.

Get-WmiObject -Class Win32_Group  

15. Win32_DiskDrive : Provides information about physical disk drives on the system.

Get-WmiObject -Class Win32_DiskDrive  | Select-Object Manufacturer, Model, Size

16. Win32_SystemDriver : Retrieves information about system drivers installed on the computer.

Get-WmiObject -Class Win32_SystemDriver | Select-Object Name, Description,StartMode ,Status, State,Pathname,ServiceType

17. Win32_VideoController : Provides information about the video controller (graphics card) installed on the system.

Get-WmiObject -Class Win32_VideoController  | Select-Object Name, AdapterRAM,CurrentHorizontalResolution,CurrentVerticalResolution,DriverDate,DriverVersion,VideoModeDescription

18. Win32_Win32_QuickFixEngineering : List all updates installed in a system,

get-wmiobject Win32_QuickFixEngineering

19. Win32_Battery : Provide detail information about laptop battery.

gwmi win32_battery | Select-Object Caption','Name','DesignVoltage','DeviceID','EstimatedChargeRemaining','EstimatedRunTime','Status', 'BatteryStatus'

20. Win32_StartupCommand : List all startup applications when system boots up.

Get-WmiObject -Class Win32_StartupCommand | Select-Object Name, Location, User, Command

WMI provides a vast array of classes that allow administrators and developers to interact with various aspects of Windows systems. In this blog post, we explored 20 useful WMI classes and provided practical examples of how they can be utilized using PowerShell. By leveraging the power of WMI, you can automate system management tasks, retrieve valuable system information, and streamline your administrative processes.



1,002 views0 comments

Recent Posts

See All

PowerShell to search specific file in entire disk

Is there a way to utilize Windows PowerShell to search for a file that I saved somewhere on my computer but cannot locate? Is there a method to locate a file throughout the entire disk and remove it a

Top 10 Benefits of using PowerShell Function

Powershell functions are blocks of reusable code that can be executed whenever needed within a PowerShell script. Functions are an essential part of PowerShell scripting, as they provide several benef

Comments


bottom of page