Get-SCSMClass
Gets a class.
Syntax
Get-SCSMClass
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SCSMClass
[-DisplayName] <String[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SCSMClass
[-Id] <Guid[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SCSMClass
[-Instance] <EnterpriseManagementObject[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SCSMClass
[-ManagementPack] <ManagementPack[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Get-SCSMClass
[-Name] <String[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Description
The Get-SCSMClass cmdlet retrieves a class.
Examples
Example 1: Get all classes that partially match a name
PS C:\>Get-SCSMClass -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-scsmclass -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-SCSMClass -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-SCSMClass -Name "System.User" | Get-SCSMClassInstance) | Select-Object -First 1 | % {$_.__enterprisemanagementobject} | Get-SCSMClass
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 (.).
Type: | System.String[] |
Position: | Named |
Default value: | Localhost |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | System.Management.Automation.PSCredential |
Position: | Named |
Default value: | Current user context |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Specifies the display name of the class to retrieve.
Type: | System.String[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | System.Guid[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Instance
Specifies an instance of a class to retrieve.
Type: | Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | Microsoft.EnterpriseManagement.Configuration.ManagementPack[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a class to retrieve.
Type: | System.String[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
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
Microsoft.EnterpriseManagement.Configuration.ManagementPackClass
This cmdlet generates a management pack object.