liveBook · Manning

Common Information Model

As explained in Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

The Common Information Model is an industry standard object-oriented model for representing and managing information about systems and resources.

The Common Information Model (CIM) is an industry-standard, object-oriented model for representing and managing system and resource information. In PowerShell automation, it provides a practical alternative to deprecated Windows Management Instrumentation (WMI) for querying computers and services. section 9.1

Use CIM when a PowerShell tool needs to:

  • Query computer hostname, manufacturer, model, operating-system details, memory, processor data, and system-drive space. section 9.1
  • Discover and invoke a class for changing a Windows service's logon name and password when Set-Service cannot perform the task. section 9.6.1 section 9.6.2
  • Verify that CIM works before building functions or script modules. section 10.3

Check CIM locally

Run Get-CimInstance win32_service -computername localhost from an administrative PowerShell session. Use a safe service such as BITS or Print Spooler for experimentation, then restore BITS to LocalSystem with no password. section 9.6.2 section 10.3

How Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools covers it

How deep it goes
Develops command discovery and prerequisite checks, but stops short of explaining CIM internals or the complete automation tool.
Examples
Uses computer inventory queries, Get-CimInstance win32_service, BITS, and Print Spooler as practical examples.
What it assumes
Assumes basic PowerShell experience and requires an administrative shell, suitable execution policy, and working CIM support.
What you can do after
Operate CIM through PowerShell to query local services and begin discovering classes for service changes.
How it connects
Connects CIM with PowerShell, Windows Management Instrumentation, service management, and Win32 classes.

Also explained in

Compare how 2 books explain Common Information Model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools. The section links point to the parts of the book it draws on.