Home > OM12, OM12 Powershell > SCOM 2012 Get-SCOMGroup list of computers

SCOM 2012 Get-SCOMGroup list of computers

Sometimes you just want to get a list of computers that are members of a group, and just want their names. This is pretty easy using the cmdlet Get-SCOMGroup, just use the –DisplayName switch and add the name of the group and pipe it to the cmdlet Get-SCOMClassInstance. To see what options are available at this point pipe it (GM) Get-Member and you will see a nice list of properties/methods available to the object in the pipe line. An Important Note to make at this point, what is in the pipeline right now are objects, and can still be massaged with PowerShell very easily. So you could sort by DisplayName and then just dump it out to a table (FT) just showing display name. Examples of what is described above:

#to load the opsmgr cmdlets import the module first

Import-Module OperationsManager

# To find out what options are available to your output of the list of objects in the group use Get-Member (GM) cmdlet

Get-SCOMGroup -DisplayName "UR Computer Group" | Get-SCOMClassInstance | GM

# after looking at the GM output we decide that DisplayName will work best

Get-SCOMGroup -DisplayName "UR Computer Group" | Get-SCOMClassInstance | sort DisplayName |FT DisplayName

This is an easy way to get a list of computers that are members of a group. Something that I need to do quite frequently now days. Hope this helps!

Advertisements
Categories: OM12, OM12 Powershell Tags:
  1. March 7, 2014 at 9:02 am

    Do you have any scripts which can list all the groups a computer is a member of? There is one out there for SCOM 2007 but never been able to port it successfully to 2012.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: