Get-SCClass

Gets classes in Operations Manager.

Syntax

Get-SCClass
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCClass
   [-DisplayName] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCClass
   [-Id] <Guid[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCClass
   [-Instance] <EnterpriseManagementObject[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCClass
   [-ManagementPack] <ManagementPack[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCClass
   [-Name] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCClass cmdlet gets one or more classes in System Center Operations Manager or an imported management pack. This command can also be executed with Get-SCOMClass.

By default, this cmdlet uses the active persistent connection to a management group. Use the SCSession parameter to specify a different persistent connection. You can create a temporary connection to a management group by using the ComputerName and Credential parameters. For more information, type Get-Help about_OpsMgr_Connections.

Examples

Example 1: Get a class by using a name

PS C:\>Get-SCClass -Name "*user"

This command gets all classes that have a name that ends with user.

Example 2: Get a class by using an ID

PS C:\>Get-SCOMClass -Id '08cfb1af-53f7-b5c7-9cea-4f814aa50ff2'

This command gets classes with a specific ID.

Example 3: Get a class by using a display name

PS C:\>Get-SCOMClass -DisplayName 'Operations Manager Management Server Group (Internal)'

This command gets classes with a specific display name.

Example 4: Get classes in a class instance

PS C:\>Get-SCOMClassInstance -DisplayName 'All Management Servers Resource Pool' | Get-SCOMClass

This command gets classes from a pipeline containing class instances.

Example 5: Get classes contained in a management pack

PS C:\>Get-SCOMManagementPack -Name 'Microsoft.Windows.Server.Library' | Get-SCOMClass

This command gets classes from a pipeline containing a management pack.

Parameters

-ComputerName

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

The System Center Data Access service must be active on the computer. If you do not specify a computer, the cmdlet uses the computer for the current management group connection.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies the user account under which the management group connection runs. Specify a PSCredential object, such as one that the Get-Credential cmdlet returns, for this parameter. For more information about credential objects, type Get-Help Get-Credential.

If you specify a computer in the ComputerName parameter, use an account that has access to that computer. The default is the current user.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Specifies the display name of the class.

Type:String[]
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Id

Specifies an array of GUIDs of classes. If you specify an ID as a string, the cmdlet converts the string to a GUID.

Type:Guid[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Instance

Specifies an array of ClassInstance objects. To obtain a ClassInstance object, use the Get-SCOMClassInstance object.

Type:EnterpriseManagementObject[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ManagementPack

Specifies an array of ManagementPack objects. To obtain a ManagementPack object, use the Get-SCManagementPack cmdlet.

Type:ManagementPack[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies an array of names of classes that this cmdlet gets.

Type:String[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SCSession

Specifies an array of Connection objects. To get Connection objects, use the Get-SCOMManagementGroupConnection cmdlet.

If this parameter is not specified, the cmdlet uses the active persistent connection to a management group. Use the SCSession parameter to specify a different persistent connection. You can create a temporary connection to a management group by using the ComputerName and Credential parameters. For more information, type Get-Help about_OpsMgr_Connections.

Type:Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject

You can pass an instance of a management pack to the Instance parameter of the Get-SCClass cmdlet by using the pipe operator. The Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject object is one the properties of the output object of the Get-SCOMClassinstance cmdlet.

System.Guid

You can pass a GUID to the Id parameter of the Get-SCClass cmdlets through the pipe operator.

Microsoft.EnterpriseManagement.Configuration.ManagementPackManagementPack

You can pass a management pack to the ManagementPack parameter of the Get-SCClass cmdlet through the pipe operator. This management pack object contains the class object.

System.String

You can pass a name to the Name parameter of the Get-SCClass cmdlet through the pipe operator.

Outputs

Microsoft.EnterpriseManagement.Configuration.ManagementPackClass

This cmdlet generates a management pack object.