This project has moved. For the latest updates, please go here.

Get-CrmRelationship

Synopsis

Get relationship metadata

Syntax

Get-CrmRelationship [-Name] <String> [<CommonParameters>]

Get-CrmRelationship [-Id] <Guid> [<CommonParameters>]

Get-CrmRelationship [[-Entity] <String>] [[-RelatedEntity] <String>] [-Include <String>] [-Exclude <String>] [-Type <CrmRelationshipType>] [-CustomOnly] [-ExcludeManaged] [<CommonParameters>]

Description

Gets the relationship metadata from an entity

Parameters

-Name <String>

Schemaname of the relationship

Required? True
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Id <Guid>

MetadataId of the relationship

Required? True
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Entity <String>

One of the entities of the relationships

Required? False
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-RelatedEntity <String>

One of the entities of the relationships

Required? False
Position? 2
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Include <String>

Filter for relationship to include based on the logicalname of the entities.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Exclude <String>

Filter for relationship to exclude based on the logicalname of the entities.

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-Type <CrmRelationshipType>

Type of relationship to get (OneToMany, ManyToMany)

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-CustomOnly <SwitchParameter>

Return custom relationships only

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

-ExcludeManaged <SwitchParameter>

Exlcude managed relationships from the result

Required? False
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

Outputs

Microsoft.Xrm.Sdk.Metadata.RelationshipMetadataBase

Notes

Examples

Get relationships

PS C:\> Get-CrmRelationship -Entity contact -RelatedEntity account -Type OneToMany

Get all one-to-many relationships between Account and Contact

Related links

RelationshipMetadataBase Class https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.metadata.relationshipmetadatabase.aspx

Last edited Mar 11 at 7:02 PM by amsoftware, version 2