Import an organization programmatically using the deployment service (CRM 2011 MSCRM)

9. May 2011 15:42
To import an organization in Microsoft CRM 2011, you can use the deploymentservice by using the BeginImportOrganizationRequest. See the code sample below BeginImportOrganizationRequest request = new BeginImportOrganizationRequest(); request.DatabaseName = "DATABASE_MSCRM"; //Name of the database which must be present at the sql server, includig _MSCRM on the end request.FriendlyName = "Company name"; //Name of the company request.SqlServerName = "http://sql01"; //url of the sql server request.SrsUrl = "http://srs01"; //url of the report server request.UniqueName = "DATABASE"; //name of the databse, excluding _MSCRM on the end request.UserMappingMethod = ImportUserMappingMethod.ByMappingXml; request.UserMappingXml = "C:\\temp.xml"; //Location of the xml BeginImportOrganizationResponse response = (BeginImportOrganizationResponse)Provider.deploymentservice.Execute(request); Note that the Request is an asynchronous request. Once you recieve the response, the database is not yet fully imported, it is just starting. In this example we use an xml file to map users. Below you find a sample xml file <MappingConfiguration><DomainMapping old=\"domainA\" new=\"domainB\" /><UserMapping old=\"domainA\\administrator\" new=\"domainB\\administrator\" /></MappingConfiguration> Make sure that u include the user who runs the code in the mapping xml as one of the users, otherwise you will get the error below: you must map your active directory user account to at least one enabled Microsft Dynamics CRM user who has the System Administrator security role before the organization can be imported  

Tags: ,

Result on Demand blog

Welcome to our CRM 2011 blog. As a Microsoft CRM hosting and implementation company, we encounter lots of CRM installation, programming and performane issues. In this blog we share our knowledge and solutions.

Month List


© Resultondemand.nl   Hosting -  Performance -  Upgrade -  Nieuw -  Over ons -  Contact -  CRM 2011 proberen

2AT - Netricity - CRM boeken

Microsoft Partner? Bekijk hier ons partner aanbod