Compartir a través de


Get-CrmConnection

Retrieves connection details for the specified Dataverse environment or Dynamics 365 Customer Engagement (on-premises) organization.

Syntax

Get-CrmConnection
   [-InteractiveMode]
   [[-MaxCrmConnectionTimeOutMinutes] <Int32>]
   [-LogWriteDirectory <String>]
Get-CrmConnection
   [-OrganizationName] <String>
   [[-ProfileName] <String>]
   [[-HomeRealmUrl] <Uri>]
   [-ServerUrl] <Uri>
   [[-Credential] <PSCredential>]
   [[-MaxCrmConnectionTimeOutMinutes] <Int32>]
   [-LogWriteDirectory <String>]
Get-CrmConnection
   [-OrganizationName] <String>
   [[-ProfileName] <String>]
   [[-DeploymentRegion] <String>]
   [-OnLineType] <OnlineType>
   [[-Credential] <PSCredential>]
   [[-MaxCrmConnectionTimeOutMinutes] <Int32>]
   [-LogWriteDirectory <String>]
Get-CrmConnection
   [-ConnectionString] <String>
   [[-MaxCrmConnectionTimeOutMinutes] <Int32>]
   [-LogWriteDirectory <String>]

Description

The Get-CrmConnection cmdlet retrieves connection details for the specified Dataverse environment or Dynamics 365 Customer Engagement (on-premises) organization.

Examples

Example 1

PS C:\> Get-CrmConnection -OrganizationName org1 -OnLineType Office365 -Credential $cred

Returns details for the specified Dataverse environment.

Example 2

PS C:\> Get-CrmConnection -OrganizationName Contoso -ServerUrl https://mycrmserver -Credential $cred

Returns details for the specified Dynamics 365 Customer Engagement (on-premises) organization.

Example 3

PS C:\> Get-CrmConnection -ConnectionString "AuthType=AD;Url=https://myserver/Contoso;Domain=contosodom;UserName=user1;Password=password"

Returns Dynamics 365 Customer Engagement (on-premises) details for the Contoso organization by using a connection string rather then the OrganizationName, ServerUrl, and Credential parameters.

Parameters

-ConnectionString

  • Connection string used to connect to Dataverse. Valid values are:
  • Server/Url/ServiceUri/Service Uri: URL of the Dynamics 365 Customer Engagement (on-premises) server.
  • UserName/User Name/UserId/User Id: Identifier of the user used to connect.
  • Password: Password for the user.
  • Domain: Domain name for the user.
  • HomeRealmUri/Home Realm Uri: Home Realm URL used to access the delegated ADFS instance.
  • AuthType/AuthenticationType: Authentication type to use to connect with Dynamics 365 Customer Engagement (on-premises) or Dataverse. Default - value is AD. Valid values are: AD, Live, IFD, Claims, Office365, and OAuth.
  • RequireNewInstance: Default value is true. Use false to reuse an instance from in-memory cache.
  • ClientId/AppId/ApplicationId: ID of your OAuth client app. This parameter is required when you use the OAuth authentication type.
  • RedirectUri/ReplyUrl: Reply URL created as part of the client Id registration. This parameter is required when you use the OAuth authentication type.
  • TokenCacheStorePath: Fully qualified file name to store tokens for reuse. Optional when you use the OAuth authentication type.
  • LoginPrompt: Allow the OAuth system to present a UI for login information. Default value is Auto. Valid values are Auto, Always, Never, and RefreshSession.
Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Credential

User credential for signing in to Dataverse or Dynamics 365 Customer Engagement (on-premises). For information about how to create this object, see Overview.

Type:PSCredential
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DeploymentRegion

Geographic region of your Dataverse environment. Valid values are NorthAmerica, EMEA, APAC, SouthAmerica, Oceania, JPN, CAN, IND, and NorthAmerica2.

Type:String
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-HomeRealmUrl

URI of the WS-Trust metadata endpoint.

Type:Uri
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-InteractiveMode

Enables you to use the common sign-in control dialog box to specify credentials for connecting to a Dataverse environment or Dynamics 365 Customer Engagement (on-premises) organization.

Type:SwitchParameter
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LogWriteDirectory

Custom directory location to store the cmdlet log files. The directory must already exist, and the user who is running the cmdlet must have Write permission to the directory. You must also use the -Verbose parameter along with the -LogWriteDirectory parameter to be able to store the log files in a custom location.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-MaxCrmConnectionTimeOutMinutes

Maximum number in minutes to wait before quitting the operation.

Type:Int32
Position:20
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-OnLineType

Type of online service. Valid value is Office365.

Type:OnlineType
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OrganizationName

Unique or friendly name of the Dataverse environment or Dynamics 365 Customer Engagement (on-premises) organization to connect to.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ProfileName

Can be used in conjunction with the InteractiveMode parameter to store connection information so that it can be reused in the Get-CrmConnection cmdlet the next time instead of re-entering the connection information again. You can create different profile names to save multiple connections.

Type:String
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ServerUrl

URL of the Microsoft Dynamics 365 Customer Engagement (on-premises) server specified in the format https://<server>:<port>.

Type:Uri
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.Management.Automation.SwitchParameter

System.String System.Uri Microsoft.Xrm.Tooling.CrmConnector.Powershell.CommandsCommonAuth+OnlineType System.Management.Automation.PSCredential System.Int32

Outputs

System.Object