Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Issue with server-based authentication with Microsoft Dynamics 365 on-premise and SharePoint Online

Posted on by Microsoft Employee

I am in the process of setting up server based authentication with Dynamics 365 on-premise and SharePoint Online. Following the instructions from here: https://technet.microsoft.com/en-us/library/mt171421.aspx?f=255&MSPPError=-2147217396

When at step 7, running the command "Set-CrmAdvancedSetting -Entity $setting" I receive the following output:

PS C:\Program Files\Microsoft Dynamics CRM\tools> $ServicePrincipalName.Add("$CRMAppId/$RootDomain")
PS C:\Program Files\Microsoft Dynamics CRM\tools> Set-MsolServicePrincipal -AppPrincipalId $CRMAppId -ServicePrincipalNames $ServicePrincipalName
PS C:\Program Files\Microsoft Dynamics CRM\tools> Add-PSSnapin Microsoft.Crm.PowerShell
PS C:\Program Files\Microsoft Dynamics CRM\tools> $setting = New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
PS C:\Program Files\Microsoft Dynamics CRM\tools> $setting.LogicalName = "ServerSettings"
PS C:\Program Files\Microsoft Dynamics CRM\tools> $setting.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
PS C:\Program Files\Microsoft Dynamics CRM\tools> $attribute1 = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ("S2SDefaultAuthorizationServerPrincipalId", "00000001-0000-0000-c000-
000000000000")
PS C:\Program Files\Microsoft Dynamics CRM\tools> $setting.Attributes.Add($attribute1)
PS C:\Program Files\Microsoft Dynamics CRM\tools> $attribute2 = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ("S2SDefaultAuthorizationServerMetadataUrl", "https://accounts.accessc
ontrol.windows.net/metadata/json/1")
PS C:\Program Files\Microsoft Dynamics CRM\tools> $setting.Attributes.Add($attribute2)
PS C:\Program Files\Microsoft Dynamics CRM\tools> Set-CrmAdvancedSetting -Entity $setting
Set-CrmAdvancedSetting : Unable to connect to the remote server
At line:1 char:1
+ Set-CrmAdvancedSetting -Entity $setting
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Crm.P...AdvancedSetting:SetCrmAdvancedSetting) [Set-CrmAdvancedSetting], WebException
    + FullyQualifiedErrorId : CRM Deployment Cmdlet Error,Microsoft.Crm.PowerShell.SetCrmAdvancedSetting

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans