Get-SCRelationshipInstance
Gets the relationship instances from Service Manager.
Syntax
Empty (Default)
Get-SCRelationshipInstance
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromRelationshipInstanceId
Get-SCRelationshipInstance
[-Id] <Guid[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromRelationshipInstanceSourceTarget
Get-SCRelationshipInstance
[[-SourceInstance] <EnterpriseManagementObject[]>]
[[-TargetInstance] <EnterpriseManagementObject[]>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Description
The Get-SCRelationshipInstance cmdlet retrieves the instances of relationships from Service Manager. These relationships describe the relationship of one ClassInstance to another ClassInstance.
Examples
Example 1: Get all relationship instances for a class
PS C:\>$HealthService = Get-SCClassInstance -Class (Get-SCClass -name "Microsoft.SystemCenter.HealthService")
PS C:\>Get-SCRelationshipInstance -SourceInstance $HealthService -TargetInstance $HealthService | Format-Table SourceObject,TargetObject -au
SourceObject TargetObject
------------ ------------
WIN-752HJBSX24M.woodgrove.com Software Deployment Workflow Target (internal)
WIN-752HJBSX24M.woodgrove.com Activity Event Workflow Configuration
WIN-752HJBSX24M.woodgrove.com System Center Operations Manager Synchronization Workflow (internal)
WIN-752HJBSX24M.woodgrove.com Grooming Workflow Target (internal)
WIN-752HJBSX24M.woodgrove.com SQL Job Workflow Target
WIN-752HJBSX24M.woodgrove.com Microsoft.ServiceManager.InternalDiscoveryCollectorTarget
WIN-752HJBSX24M.woodgrove.com Release Record Event Workflow Configuration
WIN-752HJBSX24M.woodgrove.com Change Request Event Workflow Configuration
WIN-752HJBSX24M.woodgrove.com Microsoft.EnterpriseManagement.LinkingFramework.OpsMgrConnector.SyncTaskWorkflowTarget
WIN-752HJBSX24M.woodgrove.com Subscription Workflow Target
WIN-752HJBSX24M.woodgrove.com Deployment Workflow Target
WIN-752HJBSX24M.woodgrove.com Change Request Workflow Target
WIN-752HJBSX24M.woodgrove.com Problem Workflow Target
WIN-752HJBSX24M.woodgrove.com mygroup
WIN-752HJBSX24M.woodgrove.com Linking Framework Connector Workflow Target (internal)
WIN-752HJBSX24M.woodgrove.com Microsoft.SystemCenter.MonitoringHostKeepAlive.Workflows.WorkflowTarget
WIN-752HJBSX24M.woodgrove.com Release Record Workflow Target
WIN-752HJBSX24M.woodgrove.com Authoring Workflow Target
WIN-752HJBSX24M.woodgrove.com Incident Event Workflow Configuration
WIN-752HJBSX24M.woodgrove.com Microsoft.SystemCenter.WorkflowFoundation.WorkflowTarget
WIN-752HJBSX24M.woodgrove.com WIN-752HJBSX24M.woodgrove.com
WIN-752HJBSX24M.woodgrove.com Microsoft.ServiceManager.InternalDiscoverySourceTarget
WIN-752HJBSX24M.woodgrove.com Subscriptions Workflow Target
WIN-752HJBSX24M.woodgrove.com Activity Workflow Target
WIN-752HJBSX24M.woodgrove.com WIN-752HJBSX24M.woodgrove.com
WIN-752HJBSX24M.woodgrove.com Desired Configuration Management Event Workflow Configuration
WIN-752HJBSX24M.woodgrove.com Grooming Workflow Target
WIN-752HJBSX24M.woodgrove.com Inbound E-mail Configuration Target (internal)
WIN-752HJBSX24M.woodgrove.com queue1
WIN-752HJBSX24M.woodgrove.com Workflow Target (internal)
These commands retrieve all relationship instances for which the source instance and the target instance is the HealthService class.
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 (.).
Parameter properties
Type: | System.String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | System.Management.Automation.PSCredential |
Default value: | Current user context |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Id
Specifies the ID of the relationship object to retrieve. This may be a GUID or a string that will be converted to a GUID.
Parameter properties
Type: | System.Guid[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromRelationshipInstanceId
Position: | 1 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-SourceInstance
Specifies the instances that represent the source class of the relationships to be retrieved.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromRelationshipInstanceSourceTarget
Position: | 1 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TargetInstance
Specifies the instances that represent the target class of the relationships to be retrieved.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromRelationshipInstanceSourceTarget
Position: | 2 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
System.Guid
You can pipe a GUID of a relationship object to the Id parameter of the Get-SCRelationshipInstance cmdlet.
Outputs
EnterpriseManagementRelationshipObject
This cmdlet generates a relationship object.