Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
July 12, 2022

Making Associations with CIM

Today’s article grew from a post I saw on the Facebook PowerShell group page. The question centered on the best way to filter results using Get-CimInstance. However, his query was complicated and not something most people would think to run. WMI is more intricate than you might imagine. You can think of the CIM repository as a type of database. And like a database, you can have connections. My friend was trying to query one of these connections on a remote computer. But you can make a similar query locally.

Get-CimInstance -ClassName win32_groupuser

The task was to get objects related to the local administrator’s group. If you run this command, you’ll recognize the challenge. There are plenty of ways to get this information beyond using CIM. But, his problem offers a learning opportunity on several advanced CIM topics, so that’s what I want to explore.

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.