none
CRM 4 "Importing Organization Wizard" - Unattend

    Question

  • Hi,

    Im trying to automate the import organization wizard in crm 4 and had no real luck with it.

    Im using crmdeploymentservices.asmx and was able to create the organization but the status turns out to be disabled or pending.

    the code throws an exceptions stating "the opertaion has timed out". I need to set up the user mapping as "auto-map" and finsh the install.

    Any suggestions or pointers to the code snippets would be great.

    Here is the code which is creating the organization.


    class Program
    {
        static void Main(string[] args)
        {
           
            CrmDeploymentService myDeployService = new CrmDeploymentService();
            myDeployService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            myDeployService.Url = "http://localhost:5555/MSCRMServices/2007/CrmDeploymentService.asmx";
     

            Organization newOrg = new Organization();
          
                
            newOrg.UniqueName = "TestOrg";
            newOrg.FriendlyName = "TestOrg";
            newOrg.SqlServerName = "sqlserver";
            newOrg.DatabaseName ="databasename";
            newOrg.State = OrganizationState.Enabled;
            newOrg.SrsUrl = "http://Localhost:5555/ReportServer";
           
            ImportOrganizationRequest import = new ImportOrganizationRequest();
          
           
            import.Entity=newOrg;
          
            try
            {
               ImportOrganizationResponse imported = (ImportOrganizationResponse)myDeployService.Execute(import);
               
            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                Console.WriteLine(ex.Message + "." + ex.Detail.InnerText);
            }

           
        }
    }






    thanks,
    Nav

    Tuesday, April 21, 2009 1:40 PM