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.