Using the PowerShell Get-CrmSetting
and Set-CrmSetting
cmdlets you can update the settings in your Dynamics 365 Customer Engagement (on-premises) deployment. One of the types of settings you can change is for an Internet-facing deployment (IFD).
Requirements
To set up the Dynamics 365 Customer Engagement (on-premises) PowerShell cmdlets, see Get started using the Dynamics 365 Customer Engagement Management (on-premises) PowerShell cmdlets.
Demonstrates
You can use the following script to update settings for an Internet-facing deployment (IFD). You must specify the following parameters:
DiscoveryWebServiceRootDomain – The discovery Web service domain.
Enabled - A Boolean
that indicates whether Internet-facing deployment (IFD) is enabled.
ExternalDomain - The external domain value for IFD.
OrganizationWebServiceRootDomain -The organization Web service domain.
WebApplicationRootDomain -The Web application server domain.
Example
param
(
#optional params
[string]$DiscoveryWebServiceRootDomain,
[boolean]$Enabled,
[string]$ExternalDomain,
[string]$OrganizationWebServiceRootDomain,
[string]$WebApplicationRootDomain
)
$RemoveSnapInWhenDone = $False
if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue))
{
Add-PSSnapin Microsoft.Crm.PowerShell
$RemoveSnapInWhenDone = $True
}
$IfdSettings = Get-CrmSetting -SettingType IfdSettings
if($DiscoveryWebServiceRootDomain) {$IfdSettings.DiscoveryWebServiceRootDomain = $DiscoveryWebServiceRootDomain}
if($ExternalDomain) {$IfdSettings.ExternalDomain = $ExternalDomain}
if($PSBoundParameters.ContainsKey('Enabled')) {$IfdSettings.Enabled = $Enabled}
if($OrganizationWebServiceRootDomain) {$IfdSettings.OrganizationWebServiceRootDomain = $OrganizationWebServiceRootDomain}
if($WebApplicationRootDomain) {$IfdSettings.WebApplicationRootDomain = $WebApplicationRootDomain}
Set-CrmSetting -Setting $IfdSettings
$IfdSettings
if($RemoveSnapInWhenDone)
{
Remove-PSSnapin Microsoft.Crm.PowerShell
}
See Also
Administer the deployment using Windows PowerShell
Get and set deployment configuration settings
Required steps after enabling OAuth for Dynamics 365 Server