简体   繁体   中英

Microsoft CRM Dynamics 2011 PowerShell Error when disabling an organization

Whenever I try the following line in a powershell script :

Disable-CrmOrganization -Name MyOrganization

I get the following error :

Disable-CrmOrganization : The Deployment Service cannot process the request because one or more validation checks failed.
+ Disable-CrmOrganization <<<<  -Name MyOrganization
    + CategoryInfo          : NotSpecified: (:) [Disable-CrmOrganization], FaultException`1
    + FullyQualifiedErrorId : System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFaul
   t, Microsoft.Crm.PowerShell, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],Microsoft.Crm.Pow
  erShell.DisableCrmOrganizationCmdlet

However, if I manually disable the organization, I am able to execute the following line with no problem :

Remove-CrmOrganization -Name MyOrganization

Any idea why I cannot disable the organization with powershell?

You might have run across this page: Use PowerShell to Call the Deployment Web Service for the CRM PowerShell references.

Running this command gives additional error details: $error[0].Exception.Detail.ErrorDetails

Additionally the Windows Application Event Log was showing an error (in my case anyway):

Web service request FindItems to Report Server http://myserver/reportserver/ReportService2005.asmx failed with SoapException. Error: The permissions granted to user 'NT AUTHORITY\\NETWORK SERVICE' are insufficient for performing this operation.

Which lead me to this post: http://social.microsoft.com/Forums/en/crm/thread/0dd4a41b-eeba-405c-9b56-c32bfedb9e7a

The solution was to run the CrmDeploymentServiceAppPool under an account with elevated priviledges. Logon as a service and sysadmin in SQL Server according to the post.

How to enable tracing in Microsoft Dynamics CRM

当我执行 2 次它工作所以尝试: try { Disable-CrmOrganization -Name "oragnization_name" }catch { Disable-CrmOrganization -Name "oragnization_name" }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM