Compartilhar via


Import-CrmOrganization

Initiates the process to import a Dynamics 365 organization database into the deployment.

Syntax

Import-CrmOrganization
      [-SqlServerName] <String>
      [-DatabaseName] <String>
      [-SrsUrl] <String>
      [[-DisplayName] <String>]
      [[-Name] <String>]
      [-UserMappingMethod] <ImportUserMappingMethod>
      [[-UserMappingXml] <String>]
      [[-UserMappingXmlFile] <String>]
      [-Timeout <Int32>]
      [-Diag]
      [-Credential <PSCredential>]
      [-DwsServerUrl <String>]
      [-WhatIf]
      [-Confirm]

Description

The Import-CrmOrganization cmdlet initiates the process to import a Dynamics 365 organization database into the deployment. If desired, you can provide new names and other information for the organization. If the specified organization database needs to be upgraded, this occurs as part of this operation. This is an asynchronous operation. You must poll the operation status with Get-CrmOperationStatus to determine when the operation is complete.

Examples

Example 1

PS C:\> $importJobId = Import-CrmOrganization -DatabaseName contoso_MSCRM -SqlServerName sqlserver -SrsUrl  "http://sqlserver/reportserver" http://sqlserver/reportserver -UserMappingMethod ByAccount

Begins the import process for the contos_MSCRM organization database into the Dynamics 365 deployment. You can see the progress of the operation with the PowerShell command Get-CrmOperationStatus -OperationId $importJobId.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Expects a variable that contains the user credentials used for signing in to Dynamics 365 on-premises organization. To establish this variable, run the PowerShell command $Cred = Get-Credential.

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

-DatabaseName

Specifies the name of the organization database to import. The organization database should already be attached to the computer that’s running Microsoft SQL Server.

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

-Diag

Turns on stack traces for error reports returned from Dynamics 365 service calls. Enabling this emits a detailed error message, including a stack trace, when an error is encountered by the Dynamics 365 PowerShell command.

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

-DisplayName

Specifies the friendly name of the organization. If no friendly name is provided, it defaults to the existing friendly name in the organization database that’s being imported.

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

-DwsServerUrl

The URL of the Deployment Web Service. This should be in the format: https://, for example, https://contoso.

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

-Name

Specifies the unique name of the organization. If no unique name is provided, it defaults to the existing unique name in the organization database being imported.

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

-SqlServerName

Specifies the name of the computer that’s running SQL Server that hosts the organization database to import.

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

-SrsUrl

Specifies the name of the Microsoft SQL Server Reporting Services report server for the organization being imported.

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

-Timeout

For internal use only.

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

-UserMappingMethod

Specifies a string that indicates how to map the users in the organization. Possible values are: KeepExisting, ByAccount, ByMappingXml, or ByMappingXmlFile.

Type:ImportUserMappingMethod
Accepted values:KeepExisting, ByAccount, ByMappingXml, ByFullName, ByMappingXmlFile
Position:6
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-UserMappingXml

Specifies the string containing the XML mapping. The UserMappingXml parameter is only required and used if the UserMappingMethod is set to ByMappingXml. In all other cases, this parameter is ignored.

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

-UserMappingXmlFile

Specifies the string containing the file name for the XML user mapping file. The UserMappingXmlFile parameter is only required and used if the UserMappingMethod is set to ByMappingXmlFile. In all other cases, this parameter is ignored.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

System.Int32 System.Management.Automation.SwitchParameter System.Management.Automation.PSCredential

Outputs

System.Guid