Get-SCOMRelationship
Updated: September 10, 2012
Applies To: System Center 2012 - Operations Manager, System Center 2012 SP1 - Operations Manager
Get-SCOMRelationship
Syntax
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>]
Detailed Description
The Get-SCOMRelationship cmdlet retrieves information about relationship objects from Operations Manager.
Parameters
-ComputerName<String[]>
Specifies a computer to establish a connection with. 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 |
none |
|
Accept Pipeline Input? |
false |
|
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? |
false |
|
Accept Wildcard Characters? |
false |
-DisplayName<String[]>
Specifies the display name of the relationship object to retrieve.
|
Aliases |
none |
|
Required? |
true |
|
Position? |
1 |
|
Default Value |
none |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
true |
-Id<Guid[]>
Specifies the ID of the relationship object 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 |
-ManagementPack<ManagementPack[]>
Specifies one or more management packs containing the relationships to retrieve.
You can enter a ManagementPack object that is returned by the Get-SCOMManagementPack 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 the relationship object to retrieve.
|
Aliases |
none |
|
Required? |
true |
|
Position? |
1 |
|
Default Value |
none |
|
Accept Pipeline Input? |
true (ByValue) |
|
Accept Wildcard Characters? |
true |
-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-SCOMManagementGroupConnection cmdlet.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
named |
|
Default Value |
none |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
-Source<ManagementPackClass[]>
Specifies the classes that represent the source of the relationship. If more than one class is specified, any relationship that has one of those classes as a source is returned. The source class of the relationship must be an exact match of the specified class type.
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.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
1 |
|
Default Value |
none |
|
Accept Pipeline Input? |
true (ByValue) |
|
Accept Wildcard Characters? |
false |
-Target<ManagementPackClass[]>
Specifies the classes that represent the target of the relationship. If more than one class is specified, any relationship that has one of those classes as a target is returned. The target class of the relationship must be an exact match of the specified class type.
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.
|
Aliases |
none |
|
Required? |
false |
|
Position? |
2 |
|
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.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
Microsoft.EnterpriseManagement.Configuration.ManagementPackClass
You can pipe a source class to the Source parameter of the Get-SCOMRelationship cmdlet.
-
Microsoft.EnterpriseManagement.Configuration.ManagementPackClass
You can pipe a target class to the Target parameter of the Get-SCOMRelationship cmdlet.
-
System.Guid
You can pipe a GUID to the Id parameter of the Get-SCOMRelationship cmdlet.
-
Microsoft.EnterpriseManagement.Configuration.ManagementPack
You can pipe a management pack to the ManagementPack parameter of the Get-SCOMRelationship cmdlet.
-
System.String
You can pipe a name to the Name parameter of the Get-SCOMRelationship cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
-
This cmdlet does not generate any output.
Examples
-------------------------- EXAMPLE 1 --------------------------
The command in this example retrieves information about three relationship objects.
PS C:\>Get-SCOMRelationship | select-object -first 3
-------------------------- EXAMPLE 2 --------------------------
The commands in this example retrieve relationships that target configuration items.
PS C:\>$x = Get-SCOMClass -name "system.configitem"PS C:\>Get-SCOMRelationship –Target $x
-------------------------- EXAMPLE 3 --------------------------
The commands in this example retrieve relationships that target configuration items, and any types that are derived from these configuration items.
PS C:\> $x = Get-SCOMClass -name "system.configitem"PS C:\>$y = @($x; $x.GetDerivedTypes())PS C:\>Get-SCOMRelationship –Target $y
