Get-SCSMRelationship
Gets information about relationship objects from Service Manager.
Syntax
Empty (Default)
Get-SCSMRelationship
[[-Source] <ManagementPackClass[]>]
[[-Target] <ManagementPackClass[]>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromRelationshipDisplayName
Get-SCSMRelationship
[-DisplayName] <String[]>
[[-Source] <ManagementPackClass[]>]
[[-Target] <ManagementPackClass[]>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromRelationshipId
Get-SCSMRelationship
[-Id] <Guid[]>
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromManagementPack
Get-SCSMRelationship
[-ManagementPack] <ManagementPack[]>
[[-Source] <ManagementPackClass[]>]
[[-Target] <ManagementPackClass[]>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
FromRelationshipName
Get-SCSMRelationship
[-Name] <String[]>
[[-Source] <ManagementPackClass[]>]
[[-Target] <ManagementPackClass[]>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[<CommonParameters>]
Description
The Get-SCSMRelationship cmdlet retrieves information about relationship objects from Service Manager.
Examples
Example 1: Get information about relationship objects
PS C:\>Get-SCSMRelationship | Select-Object -first 3
DisplayName : Primary User
Source : System.Computer
Target : System.User
DisplayName : Contains Configuration Item
Source : System.ConfigItem
Target : System.ConfigItem
DisplayName : Affects Customers
Source : System.ConfigItem
Target : System.User
This command retrieves information about three relationship objects.
Example 2: Get relationships that target configuration items
PS C:\>$x = Get-SCSMClass -name "system.configitem"
PS C:\>Get-SCSMRelationship -Target $x
DisplayName : Contains Configuration Item
Source : System.ConfigItem
Target : System.ConfigItem
DisplayName : Is Related to Configuration Item
Source : System.ConfigItem
Target : System.ConfigItem
DisplayName : About Configuration Item
Source : System.WorkItem
Target : System.ConfigItem
DisplayName : Is Related to Configuration Item
Source : System.WorkItem
Target : System.ConfigItem
DisplayName : Collection has configuration item
Source : Microsoft.SystemCenter.ConfigurationManager.CollectionInfo
Target : System.ConfigItem
Thse commands retrieve relationships that target configuration items.
Example 3: Get relationships that target configuration items and their derived types
PS C:\>$x = Get-SCClass -name "system.configitem"
PS C:\>$y = @($x; $x.GetDerivedTypes())
PS C:\>Get-SCSMRelationship â€"Target $y
DisplayName : Contains Configuration Item
Source : System.ConfigItem
Target : System.ConfigItem
DisplayName : Is Related to Configuration Item
Source : System.ConfigItem
Target : System.ConfigItem
DisplayName : About Configuration Item
Source : System.WorkItem
Target : System.ConfigItem
DisplayName : Is Related to Configuration Item
Source : System.WorkItem
Target : System.ConfigItem
DisplayName : Collection has configuration item
Source : Microsoft.SystemCenter.ConfigurationManager.CollectionInfo
Target : System.ConfigItem
DisplayName : Is Related to Software Item
Source : Microsoft.SystemCenter.ConfigurationManager.DCM_CI
Target : Microsoft.SystemCenter.ConfigurationManager.DCM_CI
DisplayName : Contains program
Source : Microsoft.SystemCenter.ConfigurationManager.Package
Target : Microsoft.SystemCenter.ConfigurationManager.ProgramV5
DisplayName : Hosts program
Source : Microsoft.SystemCenter.ConfigurationManager.Package
Target : Microsoft.SystemCenter.ConfigurationManager.Program
DisplayName : Contains Physical Hardware
Source : Microsoft.SystemCenter.ServiceDesigner.Messaging.Storage
Target : System.PhysicalEntity
DisplayName : Links To Knowledge Document
Source : System.Entity
Target : System.Knowledge.Article
DisplayName :
Source : Microsoft.EnterpriseManagement.LinkingFramework.OpsMgrConnector
Target : Microsoft.EnterpriseManagement.LinkingFramework.OpsMgrConnector.Config
DisplayName : Is Related to Baseline Configuration Item
Source : Microsoft.SystemCenter.WorkItem.DCMIncident
Target : Microsoft.SystemCenter.ConfigurationManager.DCM_CI
DisplayName : Is Related to Configuration Item
Source : Microsoft.SystemCenter.WorkItem.DCMIncident
Target : Microsoft.SystemCenter.ConfigurationManager.DCM_CI
DisplayName : Assigned Program
Source : Microsoft.SystemCenter.ConfigurationManager.Package
Target : Microsoft.SystemCenter.ConfigurationManager.Program
These commands retrieve relationships that target configuration items and any types that are derived from these configuration items.
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 |
-DisplayName
Specifies the display name of the relationship object to retrieve.
Parameter properties
Type: | System.String[] |
Default value: | None |
Supports wildcards: | True |
DontShow: | False |
Parameter sets
FromRelationshipDisplayName
Position: | 1 |
Mandatory: | True |
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
FromRelationshipId
Position: | 1 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ManagementPack
Specifies one or more management packs containing the relationships to retrieve.
You can enter a ManagementPack object that is returned by the Get-SCManagementPack cmdlet.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Configuration.ManagementPack[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FromManagementPack
Position: | 1 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specifies the name of the relationship object to retrieve.
Parameter properties
Type: | System.String[] |
Default value: | None |
Supports wildcards: | True |
DontShow: | False |
Parameter sets
FromRelationshipName
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 |
-Source
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.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Configuration.ManagementPackClass[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Empty
Position: | 1 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromRelationshipDisplayName
Position: | 1 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromManagementPack
Position: | 1 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromRelationshipName
Position: | 1 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Target
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.
Parameter properties
Type: | Microsoft.EnterpriseManagement.Configuration.ManagementPackClass[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Empty
Position: | 2 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromRelationshipDisplayName
Position: | 2 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromManagementPack
Position: | 2 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
FromRelationshipName
Position: | 2 |
Mandatory: | False |
Value from pipeline: | True |
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
Microsoft.EnterpriseManagement.Configuration.ManagementPackClass
You can pipe a source class to the Source parameter of the Get-SCSMRelationship cmdlet.
Microsoft.EnterpriseManagement.Configuration.ManagementPackClass
You can pipe a target class to the Target parameter of the Get-SCSMRelationship cmdlet.
System.Guid
You can pipe a GUID to the Id parameter of the Get-SCSMRelationship cmdlet.
Microsoft.EnterpriseManagement.Configuration.ManagementPack
You can pipe a management pack to the ManagementPack parameter of the Get-SCSMRelationship cmdlet.
System.String
You can pipe a name to the Name parameter of the Get-SCSMRelationship cmdlet.
Outputs
undefined
This cmdlet does not generate any output.