发布日期: 2017年1月
适用于: Dynamics 365 (on-premises),Dynamics CRM 2016
使用 PowerShellGet-CrmSetting 和 Set-CrmSetting cmdlet 可以更新 Microsoft Dynamics 365 部署中的设置。 您可以更改的设置类型之一是 Web 地址设置。
要求
若要设置 Microsoft Dynamics 365PowerShell cmdlet,请参阅 使用 Windows PowerShell 管理部署。
演示
您可以使用以下脚本更新 Web 地址设置:合作伙伴托管 (IFD)。 必须指定以下参数:
RootDomainScheme:根域架构:http 或 https。
DeploymentSdkRootDomain:部署 Web 服务的根域 (SDK)。
DiscoveryRootDomain:发现 Web 服务的根域。
NlbEnabled:一个 Boolean,指示是否已启用网络负载平衡 (NLB)。
SdkRootDomain:组织 Web 服务的根域 (SDK)。
SslHeader:安全套接字层 (SSL) 标头。
WebAppRootDomain:Web 应用程序的根域。
示例
param
(
#optional params
[string]$RootDomainScheme,
[string]$DeploymentSdkRootDomain,
[string]$DiscoveryRootDomain,
[boolean]$NlbEnabled,
[string]$SdkRootDomain,
[string]$SslHeader,
[string]$WebAppRootDomain
)
$RemoveSnapInWhenDone = $False
if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue))
{
Add-PSSnapin Microsoft.Crm.PowerShell
$RemoveSnapInWhenDone = $True
}
$WebAddressSettings = Get-CrmSetting -SettingType WebAddressSettings
if($DeploymentSdkRootDomain) {$WebAddressSettings.DeploymentSdkRootDomain = $DeploymentSdkRootDomain}
if($DiscoveryRootDomain) {$WebAddressSettings.DiscoveryRootDomain = $DiscoveryRootDomain}
if($PSBoundParameters.ContainsKey('NlbEnabled')) {$WebAddressSettings.NlbEnabled = $NlbEnabled}
if($RootDomainScheme) {$WebAddressSettings.RootDomainScheme = $RootDomainScheme}
if($SdkRootDomain) {$WebAddressSettings.SdkRootDomain = $SdkRootDomain}
if($PSBoundParameters.ContainsKey('SslHeader')) {$WebAddressSettings.SslHeader = $SslHeader}
if($WebAppRootDomain) {$WebAddressSettings.WebAppRootDomain = $WebAppRootDomain}
Set-CrmSetting -Setting $WebAddressSettings
$WebAddressSettings
if($RemoveSnapInWhenDone)
{
Remove-PSSnapin Microsoft.Crm.PowerShell
}
另请参阅
使用 Windows PowerShell 管理部署
更新部署配置设置
© 2017 Microsoft。 保留所有权利。 版权