Share via


Get-SCClass

Gets a class.

Syntax

Empty (Default)

Get-SCClass
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromClassDisplayName

Get-SCClass
    [-DisplayName] <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromClassGuids

Get-SCClass
    [-Id] <Guid[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromEMO

Get-SCClass
    [-Instance] <EnterpriseManagementObject[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromManagementPack

Get-SCClass
    [-ManagementPack] <ManagementPack[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

FromClassName

Get-SCClass
    [-Name] <String[]>
    [-SCSession <Connection[]>]
    [-ComputerName <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

The Get-SCClass cmdlet retrieves a class.

Examples

Example 1: Get all classes that partially match a name

PS C:\>Get-SCClass -name "*user"
DisplayName           Name               ManagementPackName        Id
-----------           ----               ------------------        --
Active Directory User Microsoft.AD.User  Microsoft.Windows.Library b83b8728-287a-de85-2824-916c7999b4c2
Domain User or Group  System.Domain.User System.Library            3eb2026f-1ede-e1f0-a821-c3a2036c7b1d
User                  System.User        System.Library            027e4c04-ab33-0c00-8e3b-d6f8237dee7a

DESCRIPTION: Retrieve the class with the **DisplayName** equal to "User"

PS> get-SCclass -DisplayName User

DisplayName Name        ManagementPackName Id
----------- ----        ------------------ --
User        System.User System.Library     027e4c04-ab33-0c00-8e3b-d6f8237dee7a

This command retrieves all classes that end with "user."

Example 2: Get a class by name

PS C:\>Get-SCClass -DisplayName "User"
DisplayName Name        ManagementPackName Id
----------- ----        ------------------ --
User        System.User System.Library     027e4c04-ab33-0c00-8e3b-d6f8237dee7a

This command retrieves the class in which DisplayName equals "User."

Example 3: Get the class for an object

PS C:\>(Get-SCClass -Name "System.User" | Get-SCClassInstance) | Select-Object -First 1 | % {$_.__enterprisemanagementobject} | Get-SCClass
DisplayName                    Name                           ManagementPackName             Id

-----------                    ----                           ------------------             --

Active Directory User or Group Microsoft.AD.UserBase          Microsoft.Windows.Library      783ab4dd-ccd1-6458-0817-1f2adc7dcde7

Active Directory Group         Microsoft.AD.Group             Microsoft.Windows.Library      8785d166-0637-08f5-15c0-44cec44a4d3e

Domain User or Group           System.Domain.User             System.Library                 3eb2026f-1ede-e1f0-a821-c3a2036c7b1d

This command determines the class of an object, for which all you have is the object itself.

Parameters

-ComputerName

Specifies a computer with which to establish a connection. The computer must be running the System Center Data Access service. The default value is the computer for the current management group connection.

Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name (FQDN). To specify the local computer, type the computer name, "localhost", or a dot (.).

Parameter properties

Type:

System.String[]

Default value:Localhost
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies a user account under which the management group connection will run. The account must have access to the server that is specified in the ComputerName parameter, if the server is specified. The default value is the current user.

You can enter a PSCredential object that is returned by the Get-Credential cmdlet.

Parameter properties

Type:System.Management.Automation.PSCredential
Default value:Current user context
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

Specifies the display name of the class to retrieve.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromClassDisplayName
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specifies the ID of the class to retrieve. This may be a GUID or a string that will be converted to a GUID.

Parameter properties

Type:

System.Guid[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromClassGuids
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Instance

Specifies an instance of a class to retrieve.

Parameter properties

Type:

Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromEMO
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ManagementPack

Specifies one or more management packs containing the classes to retrieve.

You can enter a ManagementPack object that is returned by the Get-SCManagementPack cmdlet.

Parameter properties

Type:

Microsoft.EnterpriseManagement.Configuration.ManagementPack[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromManagementPack
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a class to retrieve.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

FromClassName
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SCSession

Specifies a connection to a management server. The default value is the current management group connection.

You can enter a management group connection object that is returned by the Get-SCManagementGroupConnection cmdlet.

Parameter properties

Type:

Microsoft.SystemCenter.Core.Connection.Connection[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject

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

System.Guid

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

Microsoft.EnterpriseManagement.Configuration.ManagementPackManagementPack

You can pipe a management pack to the ManagementPack parameter of the Get-SCClass cmdlet. This management pack object should contain the class to retrieve.

System.String

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

Outputs

Microsoft.EnterpriseManagement.Configuration.ManagementPackClass

This cmdlet generates a management pack object.