Share via


Import-CrmOrganization

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

Syntax

Default (Default)

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:PSCredential
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:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DwsServerUrl

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

Parameter properties

Type: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:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SqlServerName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SrsUrl

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Timeout

For internal use only.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-UserMappingMethod

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

Parameter properties

Type:ImportUserMappingMethod
Default value:None
Accepted values:KeepExisting, ByAccount, ByMappingXml, ByFullName, ByMappingXmlFile
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:7
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:8
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Inputs

System.String

System.Int32

System.Management.Automation.SwitchParameter

System.Management.Automation.PSCredential

Outputs

System.Guid