Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Can not disable or enable CRM organization with Powershell

Posted on by

I am making automation for refreshing CRM organization with PowerShell. I have used Microsoft.Crm.PowerShell PS Snapin command 

Disable-CrmOrganization -Name DCRMTEST

and got an error message saying;

Disable-CrmOrganization : Source    : mscorlib
Method    : HandleReturnMessage
Date    : 13:25:30
Time    : 20.6.2017
Error    : Message: The Deployment Service cannot process the request because one or more validation checks failed.
ErrorCode: -2147167645
Stack Trace    : 
======================================================================================================================
Inner Exception Level 1    : 
==DeploymentServiceFault Info==========================================================================================
Error    : The Deployment Service cannot process the request because one or more validation checks failed.
Time    : 20.6.2017 11:25:30
ErrorCode    : -2147167645
Date    : 13:25:30
Time    : 20.6.2017
Error Items:
    SqlServerAgentCheck raising error : SQLSERVERAGENT (SQLSERVERAGENT) service is not running on the server SRVSQL01.
======================================================================================================================
At line:1 char:1
+ Disable-CrmOrganization -Name DCRMTEST
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Crm.P...anizationCmdlet:DisableCrmOrganizationCmdlet) [Disable-CrmOrganization], FaultException`1
    + FullyQualifiedErrorId : CRM Deployment Cmdlet Error,Microsoft.Crm.PowerShell.DisableCrmOrganizationCmdlet

I can disable or enable CRM organization over CRM Deployment Manager without a hassle. 

I've checked that File and Printer sharing for domain is enabled, service account for CRM is local and sysadmin on SQL server and instance where CRM database is located. TCP port 445 is opened (we have no firewall rules in internal network). Also SQL Server Agent is running and set to automatic startup.

I have disabled CRM organization over CRM Deployment Manager and than tried to  remove CRM organization from PowerShell with command; 

Remove-CrmOrganization -Name DCRMTEST

and I had removed it succesfully without any error. 

Any idea why I am getting error about SQLSERVERAGENT not running when trying to disable or enable CRM organization over PowerShell?

*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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans