Get-SCSMClass

Get-SCSMClass

Gets a class.

Syntax

Parameter Set: Empty
Get-SCSMClass [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromClassDisplayName
Get-SCSMClass [-DisplayName] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromClassGuids
Get-SCSMClass [-Id] <Guid[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromClassName
Get-SCSMClass [-Name] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromEMO
Get-SCSMClass [-Instance] <EnterpriseManagementObject[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromManagementPack
Get-SCSMClass [-ManagementPack] <ManagementPack[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Detailed Description

The Get-SCSMClass cmdlet retrieves a class.

Parameters

-ComputerName<String[]>

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 (.).

Aliases

none

Required?

false

Position?

named

Default Value

localhost

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

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.

Aliases

none

Required?

false

Position?

named

Default Value

Current user context

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-DisplayName<String[]>

Specifies the display name of the class to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Id<Guid[]>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Instance<EnterpriseManagementObject[]>

Specifies an instance of a class to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ManagementPack<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.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of a class to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SCSession<Connection[]>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject

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

  • System.Guid

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

  • Microsoft.EnterpriseManagement.Configuration.ManagementPackManagementPack

    You can pipe a management pack to the ManagementPack parameter of the Get-SCSMClass 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-SCSMClass cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.EnterpriseManagement.Configuration.ManagementPackClass

    This cmdlet generates a management pack object.

Examples

Example 1: Get all classes that partially match a name

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

PS C:\>Get-SCSMClass -name "*user"

Example 2: Get a class by name

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

PS C:\>Get-SCSMClass -DisplayName "User"

Example 3: Get the class for an object

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

PS C:\>Get-SCSMClass -Name "System.User" | Get-SCSMClassInstance |Select-Object -First 1 | %{$_.__enterprisemanagementobject}|Get-SCSMClass

Service Manager Administrator Cmdlets Group 1