I want to export a Dynamics CRM 365 solution. Tools like the ALM Toolkit e.g. didn't worked.
My Questions:
1) Is it possible to export the entire CRM365 solution by powershell at all?
2) If it is not possible by powershell - is it possible by c#?
I can connect to the crm withouth problems by powershell. But If I try to call
When I call this:
$domain = "https://mypath.com" $username = "user" $password = "password" $secPassword = New-Object -TypeName System.Security.SecureString $password.ToCharArray() | ForEach-Object {$secPassword.AppendChar($_)} $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secPassword $conn = Get-CrmConnection -Url "https://mypath.com" -Credential $credentials
$exportPath = "C:\Users\xy\Data"
Import-Module "C:\Users\xy\Scripts\Adxstudio.Xrm.PowerShell\Adxstudio.Xrm.PowerShell.dll"
Export-CrmContent -Connection $conn -OutputPath $exportPath -Uncompressed -Generalized
I get the following error:
Export-CrmContent : Metadata Contains A Reference That Cannot Be Resolved: "mypath/.../Organization.svc". In C:\Users\my.ps1:14 Char:1 + Export-CrmContent -Connection $conn -OutputPath $exportPath -Uncompre ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Export-CrmContent], InvalidOperationException + FullyQualifiedErrorId : System.InvalidOperationException,Adxstudio.Xrm.PowerShell.Cmdlets.ExportCrmContent
But if I set up the $conn by using this:
$conn= Get-CrmConnection -OrganizationName MyOrg -DeploymentRegion MyRegion -OnLineType Office365 -Credential $credentials
I can get the organizations without problems. But when I try to call the export method with this connection I get:
The Parameter "$conn" cannot be bound. The value "Microsoft.Xrm.Tooling.Connector.CrmServiceClient" of the type "Microsoft.Xrm.Tooling.Connector.CrmServiceClient" can't be converted to "Adxstudio.Xrm.PowerShell.Cmdlets.PsCrmConnection".
Are there any ideas to solve one of the both problems to export the crm solution?
*This post is locked for comments