Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Import-CrmOrganization how to change the MaxStringContentLength property?

Posted on by Microsoft Employee

When I am using Import-CrmOrganization it fails returning the response from the deployment service using Get-CrmOperationStatus.
The issue apperas when importing an CRM2011 (v. 5.0.9690.4376) organization to an CRM2013 (v. 6.1.4.145).

How can I change the MaxStringContentLength property? I guess the configuration must be  on the server and client side?

Add-PSSnapin Microsoft.Crm.PowerShell
$importJobId = Import-CrmOrganization -SqlServerName <servername> -Timeout 10000 -DatabaseName <dbname> -SrsUrl <srsur> -DisplayName <displayname -Name <Org.name> -UserMappingMethod KeepExisting -Verbose -Diag

$opstatus = Get-CrmOperationStatus -OperationId $importJobId
while($opstatus.State -eq "Processing")
{
    Write-Host [(Get-Date)] Processing...
    Start-Sleep -s 30
    $opstatus = Get-CrmOperationStatus -OperationId $importJobId
}

if($opstatus.State -eq "Failed")
{
    Throw ($opstatus.ProcessingError.Message)
}

After 5th poll (2,5 minutes) I get this message when I Get-CrmOperationStatus:

The formatter threw an exception while trying to deserialize the message: 
There was an error while trying to deserialize parameter schemas.microsoft.com/.../Services:ExecuteResult. The InnerException message was 'There was an error deserializing the object of type Microsoft.Xrm.Sdk.Deployment.DeploymentServiceResponse. 
The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans