Configure claims settings

 

Applies To: Dynamics 365 (on-premises), Dynamics CRM 2016

Using the PowerShell Get-CrmSetting and Set-CrmSetting cmdlets you can update the settings in your Microsoft Dynamics 365 deployment. One of the types of settings you can change is the claims setting.

Requirements

To set up the Microsoft Dynamics 365 PowerShell cmdlets, see Administer the deployment using Windows PowerShell.

Demonstrates

You can use the following script to enable or disable claims authentication. You must specify the following parameters:

Enabled - A Boolean that specifies whether claims authentication is enabled or disabled.

EncryptionCertificate – An encryption certificate.

FederationMetadataUrl – A URL for federation metadata.

Example

param
(
    #optional params
    [boolean]$Enabled,
    [string]$EncryptionCertificate,
    [string]$FederationMetadataUrl
)

$RemoveSnapInWhenDone = $False

if (-not (Get-PSSnapin -Name Microsoft.Crm.PowerShell -ErrorAction SilentlyContinue))
{
    Add-PSSnapin Microsoft.Crm.PowerShell
    $RemoveSnapInWhenDone = $True
}

$ClaimsSettings = Get-CrmSetting -SettingType ClaimsSettings

if($PSBoundParameters.ContainsKey('Enabled')) {$ClaimsSettings.Enabled = $Enabled}
if($EncryptionCertificate) {$ClaimsSettings.EncryptionCertificate = $EncryptionCertificate}
if($FederationMetadataUrl) {$ClaimsSettings.FederationMetadataUrl = $FederationMetadataUrl}

Set-CrmSetting -Setting $ClaimsSettings

$ClaimsSettings

if($RemoveSnapInWhenDone)
{
    Remove-PSSnapin Microsoft.Crm.PowerShell
}

See Also

Administer the deployment using Windows PowerShell
Update deployment configuration settings

© 2016 Microsoft. All rights reserved. Copyright