Get-SCOMRelationshipInstance
Retrieves the instances of relationships from Operations Manager.
Parameter Set: __AllParameterSets
Get-SCOMRelationshipInstance [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]
Parameter Set: FromRelationshipInstanceId
Get-SCOMRelationshipInstance [-Id] <Guid[]> [ <CommonParameters>]
Parameter Set: FromRelationshipInstanceSourceTarget
Get-SCOMRelationshipInstance [[-SourceInstance] <EnterpriseManagementObject[]> ] [[-TargetInstance] <EnterpriseManagementObject[]> ] [ <CommonParameters>]
The Get-SCOMRelationshipInstance cmdlet retrieves the instances of relationships from System Center 2012 – Operations Manager. These relationships describe the relationship of one class instance to another class instance.
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 (.).
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
Current user context |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies an array of GUIDs of the relationship object that this cmdlet gets. 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 |
Specifies an array of Connection objects. To obtain a Connection object, use the Get-SCOMManagementGroupConnection cmdlet.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies an array of instances that represent the source class of the relationships that this cmdlet gets. To obtain a class instance object, use the Get-SCOMClassInstance cmdlet. For more information type Get-Help Get-SCOMClassInstance
.
Aliases |
none |
Required? |
false |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
Specifies an array of instances that represent the target class of the relationships that this cmdlet gets.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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).
The input type is the type of the objects that you can pipe to the cmdlet.
System.Guid
You can pipe a GUID of a relationship object to the Id parameter of the Get-SCOMRelationshipInstance cmdlet.
The output type is the type of the objects that the cmdlet emits.
EnterpriseManagementRelationshipObject
This cmdlet generates a relationship object.
This example gets all relationship instances for which the source instance and the target instance are the Health Service class.
The first command uses the Get-SCOMClassInstance cmdlet to get the class instance. The output of the command in parentheses becomes input to the Class parameter. The cmdlet stores the result in the variable named HealthService.
The second command uses the Get-SCOMRelationshipInstance cmdlet to retrieve the relationship instance with the variable named HealthService.
PS C:\> $HealthService = Get-SCOMClassInstance -Class (Get-SCOMClass -Name Microsoft.SystemCenter.HealthService)
PS C:\> Get-SCOMRelationshipInstance -SourceInstance $HealthService -TargetInstance $HealthService | format-Table