Get-SCOMRelationship

Get-SCOMRelationship

Retrieves information about relationship objects from Operations Manager.

構文

Parameter Set: Empty
Get-SCOMRelationship [[-Source] <ManagementPackClass[]> ] [[-Target] <ManagementPackClass[]> ] [ <CommonParameters>]

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

Parameter Set: FromManagementPack
Get-SCOMRelationship [-ManagementPack] <ManagementPack[]> [[-Source] <ManagementPackClass[]> ] [[-Target] <ManagementPackClass[]> ] [ <CommonParameters>]

Parameter Set: FromRelationshipDisplayName
Get-SCOMRelationship [-DisplayName] <String[]> [[-Source] <ManagementPackClass[]> ] [[-Target] <ManagementPackClass[]> ] [ <CommonParameters>]

Parameter Set: FromRelationshipId
Get-SCOMRelationship [-Id] <Guid[]> [ <CommonParameters>]

Parameter Set: FromRelationshipName
Get-SCOMRelationship [-Name] <String[]> [[-Source] <ManagementPackClass[]> ] [[-Target] <ManagementPackClass[]> ] [ <CommonParameters>]

詳細説明

The Get-SCOMRelationship cmdlet retrieves information about relationship objects from System Center 2012 – Operations Manager.

パラメーター

-ComputerName<String[]>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Credential<PSCredential>

Specifies a PSCredential object for the management group connection. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, 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.

エイリアス

なし

必須?

false

位置は?

named

既定値

Current user context

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DisplayName<String[]>

Specifies an array of display names of the relationship object to retrieve.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

true

-Id<Guid[]>

Specifies an array of GUIDs of the relationship object to retrieve. This may be a GUID or a string that will be converted to a GUID.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-ManagementPack<ManagementPack[]>

Specifies an array of management packs containing the relationships to retrieve. To obtain a ManagementPack object, use the Get-SCOMManagementPack cmdlet.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Name<String[]>

Specifies an array of names of the relationship object to retrieve.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-SCSession<Connection[]>

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

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Source<ManagementPackClass[]>

Specifies an array of classes that represent the source of the relationship. If you specify more than one class, the cmdlet returns any relationship that includes one of those classes as a source. The source class of the relationship must match the specified class type. To obtain a ManagementPackClass object, use the Get-SCOMClass cmdlet.

If you specify classes for both the Target and the Source parameters, the cmdlet returns all relationships in which the target class is one of the specified target classes and the source class is one of the specified source classes.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Target<ManagementPackClass[]>

Specifies an array of classes that represent the target of the relationship. If you specify more than one class, the cmdlet returns any relationship that includes one of those classes as a target. The target class of the relationship must match the specified class type. To obtain a ManagementPackClass object, use the Get-SCOMClass cmdlet.

If you specify classes for both the Target and the Source parameters, the cmdlet returns all relationships in which the target class is one of the specified target classes and the source class is one of the specified source classes.

エイリアス

なし

必須?

false

位置は?

3

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • Microsoft.EnterpriseManagement.Configuration.ManagementPackClass

    You can pass a source class to the Source parameter of the Get-SCOMRelationship cmdlet by using the pipeline operator.

  • Microsoft.EnterpriseManagement.Configuration.ManagementPackClass

    You can pass a target class to the Target parameter of the Get-SCOMRelationship cmdlet by using the pipeline operator.

  • System.Guid

    You can pass a GUID to the Id parameter of the Get-SCOMRelationship cmdlet by using the pipeline operator.

  • Microsoft.EnterpriseManagement.Configuration.ManagementPack

    You can pass a management pack to the ManagementPack parameter of the Get-SCOMRelationship cmdlet by using the pipeline operator.

  • System.String

    You can pipe a name to the Name parameter of the Get-SCOMRelationship cmdlet by using the pipeline operator.

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • This cmdlet does not generate any output.

Example 1: Retrieve relationship information

This command retrieves information about the first three relationship objects.

PS C:\> Get-SCOMRelationship | Select-Object -first 3

Example 2: Retrieve relationship information for configuration items

This example retrieves relationships that target configuration items.

The first command uses the Get-SCOMClass cmdlet to retrieve the class for an item by name, and stores the result in the variable named X.

The second command uses the Get-SCOMRelationship cmdlet to get the relationship.

PS C:\> $X = Get-SCOMClass -Name "system.configitem"
PS C:\> Get-SCOMRelationship –Target $X

Example 3: Retrieve relationship information for derived types

This example retrieves relationships that target configuration items, as well as any types that derive from these configuration items.

The first command uses the Get-SCOMClass cmdlet to retrieve the class for an item by name, and stores the result in the variable named X.

The second command uses the GetDerivedTypes method and stores the result in the variable named Y.

The third command uses the Get-SCOMRelationship cmdlet to get the relationship for the derived types.

PS C:\> $X = Get-SCOMClass -Name "system.configitem"
PS C:\> $Y = @($X; $X.GetDerivedTypes())
PS C:\> Get-SCOMRelationship –Target $Y


関連トピック

Get-SCOMClass

Get-SCOMManagementPack