PowerTip: Use CIM Cmdlets to Find WMI Classes

PowerTip: Use CIM Cmdlets to Find WMI Classes

  • Comments 1
  • Likes

Summary: Use the CIM cmdlets in Windows PowerShell to find associated WMI classes.

Hey, Scripting Guy! Question How can I find the associated classes for a WMI object?

Hey, Scripting Guy! Answer Use the Windows PowerShell 3.0 CIM cmdlets.

First get the WMI object for which you want find the associated classes:

$group = Get-CimInstance -ClassName Win32_Group  -Filter "Name = 'Administrators'"

Then find the associated classes:

Get-CimAssociatedInstance -InputObject $group | select CimClass –Unique

Then choose and use the class you need:

Get-CimAssociatedInstance -InputObject $group -ResultClassName Win32_UserAccount

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Good Tip