Customer Engagement (on-premises) と SharePoint Online でのサーバーベース認証の構成

このトピックでは、Dynamics 365 Customer Engagement (on-premises) と Microsoft SharePoint Online 間でサーバーベース認証を構成する方法について説明します。

必要なアクセス許可

Customer Engagement (on-premises)

  • システム管理者セキュリティ ロール。 これは、Customer Engagement (on-premises) でサーバーベースの SharePoint 統合の有効化ウィザードを実行するときに必要となります。

  • 評価目的で自己署名証明書を使用する場合は、Microsoft Dynamics 365 Server を実行しているコンピューターでローカルの Administrators グループ メンバーシップを持っている必要があります。

SharePoint Online

  • Office 365 グローバル管理者メンバーシップ。 これは、Office 365 サブスクリプションへの管理レベルのアクセスのために、また Microsoft AzurePowerShell コマンドレットを実行するために必要です

Customer Engagement (on-premises) と SharePoint Online でのサーバーベース認証の設定

指定された順序で手順を実行して、Customer Engagement (on-premises) を SharePoint Online に対して設定します。

重要

  • ここで説明する手順は、指定されている順序で実行する必要があります。 エラー メッセージを返す Windows PowerShell コマンドなどで作業が完了しない場合は、次のコマンド、作業、またはステップに進む前に、問題を解決しておく必要があります。

  • サーバー ベースの SharePoint統合を有効にすると、以前のクライアントベースの認証方式に戻ることができなくなります。 つまり、サーバーベースの SharePoint 統合に Customer Engagement (on-premises) 組織を構成した後は、Microsoft Dynamics CRM リスト コンポーネントを使用することはできません。

  • 複数の Customer Engagement (on-premises) 組織を同じ Customer Engagement (on-premises) 展開内で複数の SharePoint Online サイトに接続するには、SharePoint Online サイトが同じ Microsoft Office 365 テナント内に存在する必要があります。

前提条件の確認

サーバーベース認証用に Customer Engagement (on-premises) と SharePoint Online を構成する前に、次の前提条件が満たされている必要があります。

  • Customer Engagement (on-premises) の展開が既に構成されていて、インターネット経由で利用可能である必要があります。 詳細: Dynamics 365 for Customer Engagement (on-premises) 用 IFD を構成する

  • Microsoft Dynamics 365 Hybrid Connector。 Microsoft Dynamics 365 Hybrid Connector は、 Dynamics 365 (on-premises) と SharePoint オンラインでサーバーベース認証を使用できるようにする無料のコネクタです。 詳細: Microsoft Dynamics CRM ハイブリッド コネクタ

  • Customer Engagement (on-premises) と SharePoint Online 間の認証に使用される、信頼された証明機関によって発行された X509 デジタル証明書。 サーバーベース認証を評価する場合は、自己署名証明書を使用できます。

次のソフトウェア機能は、このトピックで説明する Windows PowerShell のコマンドレットの実行に必要となります。

重要

この記述の時点では、IT プロフェッショナル用 Microsoft Online Services サインイン アシスタントの RTW バージョンには問題がありました。 この問題が解決するまでは、ベータ版の使用をお勧めします。 詳細: Microsoft Azure フォーラム: Windows PowerShell 用 Azure Active Directory モジュールをインストールすることができません。MOSSIA がインストールされません。

サーバーベース認証の設定

  1. 展開ツールのサーバー ロールが実行されている Dynamics 365 Server で、Windows PowerShell の Azure Active Directory モジュールを開始します。

    重要

    次の PowerShell コマンドを実行するコンピューターには、前に前提条件の確認で説明した前提条件のソフトウェア機能がある必要があります。

  2. 証明書を準備します。

    $CertificateScriptWithCommand = “.\CertificateReconfiguration.ps1 -certificateFile c:\Personalcertfile.pfx -password personal_certfile_password -updateCrm -certificateType S2STokenIssuer -serviceAccount contoso\CRMWebApplicationService -storeFindType FindBySubjectDistinguishedName”
    
     Invoke-Expression -command $CertificateScriptWithCommand
    
  3. PowerShell セッションを準備します。

    次のコマンドレットにより、コンピューターがリモート コマンドを受け取り、 Office 365 モジュールを PowerShell セッションに追加できます。

    Enable-PSRemoting -force
    New-PSSession
    Import-Module MSOnline -force
    Import-Module MSOnlineExt -force
    
  4. Office 365 に接続。

    Connect-MsolService コマンドを実行するとき、必要な SharePoint Online ライセンス用 Office 365 グローバル管理者メンバーシップを保持している有効な Microsoft アカウントを提供する必要があります。

    こちらにリストされた Azure Active Directory PowerShell コマンド用の各MSOnline モジュールについての詳細は、 MSOnline を参照してください。

    $msolcred = get-credential
    connect-msolservice -credential $msolcred
    
  5. 証明書を設定します。

    $Certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
    $Certificate.Import(“c:\Personalcertfile.cer”)
    $CERCertificateBin = $Certificate.GetRawCertData()
    $CredentialValue = [System.Convert]::ToBase64String($CERCertificateBin)
    
  6. Azure Active Directory サービス プリンシパル名 (SPN) を SharePointで設定します。

    *.contoso.com を Microsoft Dynamics 365 Server が存在するドメイン名に置き換えます。

    重要

    New-MsolServicePrincipalCredential コマンドの タイプ パラメータとしてサポートされるのは非対称キーのみです。 対称キーまたはパスワード キーは安全ではないため無効になっています。

    $RootDomain = “*.contoso.com”
    $CRMAppId = "00000007-0000-0000-c000-000000000000" 
    New-MsolServicePrincipalCredential -AppPrincipalId $CRMAppId -Type asymmetric -Usage Verify -Value $CredentialValue
    $CRM = Get-MsolServicePrincipal -AppPrincipalId $CRMAppId
    $ServicePrincipalName = $CRM.ServicePrincipalNames
    $ServicePrincipalName.Remove("$CRMAppId/$RootDomain")
    $ServicePrincipalName.Add("$CRMAppId/$RootDomain")
    Set-MsolServicePrincipal -AppPrincipalId $CRMAppId -ServicePrincipalNames $ServicePrincipalName
    
  7. SharePoint でサーバーベース認証用に Microsoft Dynamics 365 Server を構成します。

    Add-PSSnapin Microsoft.Crm.PowerShell 
    $setting = New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
    $setting.LogicalName = "ServerSettings"
    $setting.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
    $attribute1 = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ("S2SDefaultAuthorizationServerPrincipalId", "00000001-0000-0000-c000-000000000000")
    $setting.Attributes.Add($attribute1)
    $attribute2 = New-Object "System.Collections.Generic.KeyValuePair[String, Object]" ("S2SDefaultAuthorizationServerMetadataUrl", "https://accounts.accesscontrol.windows.net/metadata/json/1")
    $setting.Attributes.Add($attribute2)
    Set-CrmAdvancedSetting -Entity $setting
    

サーバーベースの SharePoint 統合ウィザード有効化の実行

  1. Customer Engagement (on-premises) で、ドキュメント管理に移動します。

  2. ドキュメント管理領域で、サーバーベースの SharePoint 統合の有効化 を選択します。

  3. 情報を確認し、 次へ を選択します。

  4. SharePoint サイトで オンライン を選択し、次へ を選択します。

  5. [サイトの準備] の段階で、以下の情報を入力します。

    • https://contoso.sharepoint.com/sites/salesteam などの、 SharePoint オンライン サイト コレクション URL を入力します。

    • テナント ID を入力します。 詳細: SharePoint オンライン テナントIDを取得します。

  6. 次へを選択します。

  7. サイトの検証セクションが表示されます。 すべてのサイトが有効であると決定された場合、 有効化を選択します。 1 つ以上のサイトが無効であると決定された場合、 サーバー ベース認証のトラブルシューティングを参照してください。

SharePoint online テナント ID の取得

PowerShell の使用

  1. Windows PowerShell シェルの Azure Active Directory モジュールで、次のコマンドを実行します。

    $CRMContextId = (Get-MsolCompanyInformation).ObjectID
    $CRMContextId
    
  2. クリップボードに表示される GUID をコピーします。

サイトの設定の使用

  1. Customer Engagement (on-premises) でのドキュメント管理に使用する SharePoint サイト コレクションにサインインします。

  2. サイトの設定>サイト アプリの権限 に移動します。

    テナント ID が アプリ ID の下、@ 記号の右側に表示されます。 GUID だけをコピーして貼り付けます。 @ の左側の識別子の部分は貼り付けないでください。

サーバーベース認証の有効化ウィザードの検証に関する問題のトラブルシューティング

認証の失敗。 このエラーは、サーバー間認証に使用した証明書が不明または無効な場合に返される可能性があります。