Add-CrmDatabase

Applies To: CRM 2016 on-prem, Dynamics 365 (on-premises)

Add-CrmDatabase

Adds a Microsoft Dynamics 365 database from a Microsoft SQL Server MDF (raw database file) or a SQL Server backup file.

Syntax

Parameter Set: AttachDB
Add-CrmDatabase [-SqlServerName] <String> [-DatabaseName] <String> [-DatabaseMdfFileName] <String> [[-DatabaseLdfFileName] <String> ] [-Credential <PSCredential> ] [-Diag] [-DwsServerUrl <String> ] [-Timeout <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreDB
Add-CrmDatabase [-SqlServerName] <String> [-DatabaseName] <String> [-DatabaseBackupFileName] <String> [-Credential <PSCredential> ] [-Diag] [-DwsServerUrl <String> ] [-Timeout <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Add-CrmDatabase cmdlet adds a Microsoft Dynamics 365 organization database to your deployment from a backup of a database or from a detached database.

Parameters

-Credential<PSCredential>

Specifies the credentials used to log in to the Deployment web service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DatabaseBackupFileName<String>

Specifies the name of the SQL Server backup file. This should be a full backup file of the source Microsoft Dynamics 365 database. This file must be accessible from the computer that’s running SQL Server.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseLdfFileName<String>

The name of the SQL Server Database LDF file.This file must be accessible from the computer that’s running SQL Server.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseMdfFileName<String>

Specifies the name of the SQL Server Database MDF file. This file must be accessible from the computer that’s running SQL Server.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseName<String>

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

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Diag

Turns on stack traces for error reports returned from Microsoft 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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DwsServerUrl<String>

Identifies the location of the Deployment web service. This should be in the format: http://<serverurl> or https://<serverurl>, for example, http://contoso.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SqlServerName<String>

Specifies a string that contains the name of the Microsoft SQL Server or SQL Server instance on which to create or attach the organization database.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Timeout<Int32>

For internal use only.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

PS C:\> 
PS C:\>