Мощная комбинация

Albert Eromosele

Windows PowerShell WMI vs CIM image produced by Crawlwise Solution

Windows Management Instrumentation (WMI)

WMI (Windows Management Instrumentation) is a tool from Microsoft that allows you to gather information and manage Windows computers, both locally and remotely. WMI can be used to perform tasks such as querying system information, configuring settings, invoking methods, and subscribing to events. PowerShell provides several cmdlets that can work with WMI, such as Get-WmiObject, Invoke-WmiMethod, and Register-WmiEvent. These cmdlets use the Distributed Component Object Model (DCOM) protocol to communicate with remote computers.

Key Points

  1. Querying: You can use WMI to ask specific questions about a computer, similar to searching in a database.
  2. Event Alerts: WMI can notify you about certain events, like when a new program starts.
  3. Usage: It’s often used by system administrators to monitor and manage computers.
  4. Scripting: You can write scripts to automate tasks using WMI.
  5. Security: You can set who has access to WMI data.
  6. Remote Access: It lets you manage other computers in the network from your computer.

In short, WMI is a tool for managing and monitoring Windows computers.

Common Information Model (CIM)

PowerShell CIM is a way of using PowerShell to work with the Common Information Model (CIM), which is a standard for representing and managing information about systems and devices. CIM is based on the Distributed Management Task Force (DMTF) standards, and it allows you to access and manipulate data from different platforms and vendors. PowerShell CIM uses the Windows Remote Management (WinRM) protocol to communicate with remote computers, and it provides a set of cmdlets that can interact with both Windows Management Instrumentation (WMI) and CIM classes and instances. PowerShell CIM is more secure, compatible, and efficient than the older WMI cmdlets, and it does not require PowerShell to be installed on the target computer. You can use PowerShell CIM to perform tasks such as querying system information, configuring settings, invoking methods, and subscribing to events.

:/>  Как на клавиатуре нажать вставить скопированное

Key Points

  1. CIM Cmdlets: In PowerShell, cmdlets are commands written in .NET that execute specific actions. With PowerShell v3 and later, Microsoft introduced a set of cmdlets specifically for CIM, often referred to as “CIM cmdlets.” These provide an easier and more consistent way to interact with management data than traditional WMI cmdlets.
  2. CIM Session: Unlike traditional WMI, where you’d usually work with remote systems through DCOM (Distributed Component Object Model), CIM cmdlets use WS-Man (Web Services for Management) protocol by default. CIM sessions make it simpler and more efficient to manage remote systems.
  3. Flexibility: CIM cmdlets can still interact with the traditional WMI classes, but they can also work with any CIM compliant data source, which makes them more versatile.
  4. Interoperability: Because CIM is a standards-based model, using CIM cmdlets in PowerShell ensures better interoperability with other platforms and devices that are CIM-compliant.
  5. Common Tasks: With CIM cmdlets, you can retrieve management data, invoke methods, and subscribe to events just like with traditional WMI. However, the way you do these tasks might be more streamlined and consistent.

A common example of using CIM in PowerShell is the `Get-CimInstance` cmdlet, which can retrieve management information similar to the older `Get-WmiObject` cmdlet but with the benefits of the CIM framework.

In essence, PowerShell’s CIM integration offers a modernized way to access and manage system information, with a more consistent and flexible approach compared to traditional WMI.