Use Advanced Configuration Settings (ConfigDB)
In addition to the core deployment entities and messages described so far, the Microsoft Dynamics CRM 2011 deployment service allows you to read and update advanced deployment settings stored in the configuration database.
Important |
|---|
| You should use the advanced settings only when indicated to do so by the Microsoft Dynamics CRM customer support representatives. |
You can use the RetrieveAdvancedSettingsRequest message specifying the name of the table from the configuration database. Some of these settings are writable and if you are directed to they can be updated using the UpdateAdvancedSettingsRequest message.
Configuration Database Tables
The following table lists the possible tables you can retrieve and set using the RetrieveAdvancedSettingsRequest message.
| Configuration database table name | Description |
|---|---|
|
CrmKeySetting |
Contains key settings specific to each type of key. |
|
Deployment |
Contains deployment settings. |
|
Organization |
Contains organization data required outside organization context. |
|
OrganizationFeatureMap |
Contains a listing of enabled features. |
|
ServerSettings |
Contains server settings for the Microsoft Dynamics CRM Online server. |
Example
The following sample shows how to retrieve a table from the configuration database and update a setting.
RetrieveAdvancedSettingsRequest request = new RetrieveAdvancedSettingsRequest() { ConfigurationEntityName = "Deployment"; ColumnSet.AllColumns = false; // Returns only writable properties. } RetrieveAdvancedSettingsResponse response = service.Execute(request); ConfigurationEntity configEntity = response.Entity; ConfigurationEntity entity = new ConfigurationEntity(); entity.LogicalName = "Deployment"; entity.Attributes = new AttributeCollection(); entity.Attributes.Add(new KeyValuePair<string, object>("AutomaticallyInstallDatabaseUpdates", true)); UpdateAdvancedSettingsRequest request2 = new UpdateAdvancedSettingsRequest(); request.Entity = entity; service.Execute(request);
Read and Update Advanced Settings with PowerShell
In Windows PowerShell, you can use the Get-CrmAdvancedSetting and Set-CrmAdvancedSetting commands to get all values from the advanced settings tables, and set writable values in the tables. However, you cannot use the returned object from Get-CrmAdvancedSetting for Set-CrmAdvancedSetting. Use the following PowerShell script to set one of the writable settings. This script can be found in the SDK download package in the SampleCode\PS\SetAdvancedSettings.ps1 file.
param ( #optional params [string]$ConfigurationEntityName, [string]$SettingName, [object]$SettingValue, [Guid]$Id ) $RemoveSnapInWhenDone = $False if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue)) { Add-PSSnapin Microsoft.Crm.PowerShell $RemoveSnapInWhenDone = $True } $setting = New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity" $setting.LogicalName = $ConfigurationEntityName if($Id) { $setting.Id = $Id } $setting.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection" $keypair = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ($SettingName, $SettingValue) $setting.Attributes.Add($keypair) Set-CrmAdvancedSetting -Entity $setting if($RemoveSnapInWhenDone) { Remove-PSSnapin Microsoft.Crm.PowerShell }
See Also
Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2012 Microsoft Corporation. All rights reserved.

Important