Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Sample: Configure IFD (PowerShell)

[Applies to: Microsoft Dynamics CRM 2011]

This sample code is for Microsoft Dynamics CRM 2011, and can be found in the following location in the SDK download:

SampleCode\PS1\ConfigureIfd.ps1

Requirements

To set up the Microsoft Dynamics CRM PowerShell cmdlets, see Use PowerShell to Call the Deployment Web Service.

Demonstrates

The following script will configure 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

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.