Installing Update Rollups on Microsoft Dynamics CRM Reliably.

I've been working with CRM for a little over 7 years now and in that time I've gone through the process of installing rollup updates probably hundreds of times. In our development environment we have about 12 CRM servers ranging anywhere from CRM 4.0 up to Dynamics 365.
On one of our DEV servers we have around 53 CRM Organisations. Today I'd like to share with you one of my methods for updating a CRM server and all of its organisations in a way that minimises down time per organisation.

When you install an update rollup on a CRM server, it disables all of the organisations while the update is running. The updater will update the server components first and then start deploying the update on all of the databases one organisation at a time. This means that if you have multiple organisations like we do, every organisation could be offline for hours. The process that I use allows you to use the databases that are not yet updated as well as the ones that have been updated. Here's how it works.

  • Disable all CRM Organisations.
  • Install the Rollup update.
  • Enable all CRM Organisations.
  • Update all CRM Organisations.

Take a backup of all of the databases first!

Of course we are going to use powershell to do all of this, let's dive in!
First you need to add the crm powershell snapin.

Note: you need to do this in every new PowerShell session first.

Add-PSSnapin Microsoft.crm.powershell

Type the following into a PowerShell window to disable the orgs.

$Orgs = Get-CrmOrganization
foreach($org in $orgs)
{
    Disable-CrmOrganization -Name $org.UniqueName
}

It will take a while to run, but if you open up the deployment manager, you will see it slowly going through each Org and disabling them.

Once all of the organisations are disabled, install the Update Rollup and restart the server if required.

Now you will have to enable all of the organisations. Type the following into PowerShell:

$Orgs = Get-CrmOrganization
foreach($org in $orgs)
{
    Enable-CrmOrganization -Name $org.UniqueName
}

Take a look at the Organisations in deployment manager and take note of the "Update" column. It should have "Available" next to each org.

Now we are going to apply the update to each org and store the JobID so that we can check the progress.

$Orgs = Get-CrmOrganization
$JobID = @()
foreach($org in $orgs)
{
    $JobID += Update-CrmOrganization -Name $org.UniqueName
}

$JobID.ForEach({Get-CrmOperationStatus -OperationId $_ -Diag | select *})

If you want to check to see how the queue is progressing you can run the last line again.

$JobID.ForEach({Get-CrmOperationStatus -OperationId $_ -Diag | select *})

Unfortunately you can't see which organisation is being updated, just how many have been VS how many have not.

That's pretty much it! The updates are handled by the CRM server, so if you don't care about the progress, you can go ahead and log out of the server and check it later for errors.