Share via


設定搭配 Dynamics 365 Online 及 SharePoint 內部部署使用的伺服器架構驗證

 

發行︰ 2017年2月

適用於: Dynamics 365 (online)、Dynamics 365 (on-premises)、Dynamics CRM 2016、Dynamics CRM Online

隨著 Microsoft Dynamics CRM Online 2015 更新 1 引入後,適用於文件管理的伺服器架構 Microsoft SharePoint 整合可以用來連接 Microsoft Dynamics 365 (線上) 與 SharePoint 內部部署。 當使用伺服器架構驗證時,Azure AD 網域服務 會當做信任代理人,使用者並不需要登入 SharePoint。

Dynamics 365 (線上) 和 SharePoint 內部部署

本主題內容

需要權限

設定搭配 Dynamics 365 (線上) 及 SharePoint 內部部署使用的伺服器對伺服器驗證

新增商務用 OneDrive 整合

選擇宣告型驗證設定對應類型

需要權限

Office 365

  • Office 365 全域管理員成員資格 - 這是對 Microsoft Office 365 訂閱進行管理層級存取,以及執行 Microsoft AzurePowerShell Cmdlet 所需的必要項。

Microsoft Dynamics 365 (線上)

  • 執行 SharePoint 整合精靈。 這是在 Microsoft Dynamics 365 中執行 [啟用伺服器架構驗證] 精靈所需的必要項。

    根據預設,系統管理員資訊安全角色具備此權限。

SharePoint 內部部署

  • 伺服器陣列管理員群組成員資格 - 這是在 SharePoint 伺服器上執行大部分的 PowerShell 命令所需。

設定搭配 Dynamics 365 (線上) 及 SharePoint 內部部署使用的伺服器對伺服器驗證

依提供的順序執行步驟,以設定 Dynamics 365 (線上) 與 SharePoint 2013 內部部署。

重要

  • 必須依照提供的順序完成此處所述的步驟。 如果未完成工作 (例如傳回錯誤訊息的 PowerShell 命令),必須先將目標解決,才能繼續執行下一個命令、工作或步驟。

  • 一旦啟用伺服器架構 SharePoint 整合,您就無法還原為先前的用戶端驗證方法。 因此,您無法使用 Microsoft Dynamics CRM 清單元件,在您設定 Dynamics 365 組織進行伺服器架構 SharePoint 整合之後。

確認先決條件

在您設定 Microsoft Dynamics 365 (線上) 和 SharePoint 內部部署進行伺服器架構驗證之前,必須符合下列先決條件:

SharePoint 先決條件

其他先決條件

  • SharePoint Online 授權。Microsoft Dynamics 365 (線上) 至 SharePoint 內部部署伺服器型驗證必須在 Azure Active Directory 中註冊 SharePoint 服務主體名稱 (SPN)。 若要達成此目標,至少需要一個 SharePoint Online 使用者授權。SharePoint Online 授權可以從單一使用者授權衍生,而且通常隨附下列其中一項:

    • SharePoint Online 訂閱。 所有 SharePoint Online 方案都足夠,即使未指派授權給使用者。

    • 包含 SharePoint Online的 Office 365 訂閱。 例如,如果您有 Office 365 E3,您有適當授權,即使未指派授權給使用者。

    如需這些方案的詳細資訊,請參閱 Office 365:選擇方案比較 SharePoint 選項

  • 必須有下列軟體功能,才能執行本主題所述的 PowerShell Cmdlet。

    重要

    撰寫本文時,適用於 IT 專業人員的 Microsoft Online Services 登入小幫手 RTW 版本有問題。 在解決問題之前,建議您使用 Beta 版其他資訊:Microsoft Azure 論壇:無法安裝 Azure Active Directory Module for Windows PowerShell。MOSSIA 未安裝

  • 適當的宣告型驗證對應類型,可在 Microsoft Dynamics 365 (線上) 和 SharePoint 內部部署之間用來對應身分識別。 預設會使用電子郵件地址。其他資訊:授與 Microsoft Dynamics 365 權限以存取 SharePoint,並設定宣告型驗證對應

更新 Azure Active Directory 網域服務中的 SharePoint Server SPN

在 SharePoint 內部部署伺服器的 SharePoint 2013 管理命令介面中,依指定順序執行下列 PowerShell 命令。

  1. 準備 PowerShell 工作階段。

    下列 Cmdlet 可讓電腦接收遠端命令,並將 Office 365 模組新增至 PowerShell 工作階段。 如需這些 Cmdlet 的詳細資訊,請參閱 Windows PowerShell 核心 Cmdlet (英文)。

    Enable-PSRemoting -force
    New-PSSession
    Import-Module MSOnline -force
    Import-Module MSOnlineExtended -force
    
  2. 連線至 Office 365。

    當您執行 Connect-MsolService 命令時,必須提供具備必要 SharePoint Online 授權所需之 Office 365 全域管理員成員資格的有效 Microsoft 帳號。

    如需此處所列其中每個 Azure Active DirectoryPowerShell 命令的詳細資訊,請參閱 MSDN:使用 Windows PowerShell 管理 Azure AD

    $msolcred = get-credential
    connect-msolservice -credential $msolcred
    
  3. 設定 SharePoint 主機名稱。

    您設定的 HostName 變數值必須是 SharePoint 網站集合的完整主機名稱。 主機名稱必須衍生自網站集合 URL 並且區分大小寫。 在此範例中,網站集合 URL 是 *https://SharePoint.constoso.com/sites/salesteam*,因此主機名稱是 SharePoint.contoso.com

    $HostName = "SharePoint.contoso.com"
    
  4. 取得 Office 365 物件 (用戶) 和 SharePoint Server 服務主體名稱 (SPN)。

    $SPOAppId = "00000003-0000-0ff1-ce00-000000000000"
    $SPOContextId = (Get-MsolCompanyInformation).ObjectID
    $SharePoint = Get-MsolServicePrincipal -AppPrincipalId $SPOAppId
    $ServicePrincipalName = $SharePoint.ServicePrincipalNames
    
  5. 在 Azure Active Directory 中設定 SharePoint Server 服務主體名稱 (SPN)。

    $ServicePrincipalName.Add("$SPOAppId/$HostName") 
    Set-MsolServicePrincipal -AppPrincipalId $SPOAppId -ServicePrincipalNames $ServicePrincipalName 
    

完成這些命令後,不要關閉 SharePoint 2013 管理命令介面,請繼續執行下一個步驟。

更新 SharePoint 領域以符合 SharePoint Online 的領域。

在 SharePoint 內部部署伺服器的 SharePoint 2013 管理命令介面中,執行這個 Windows PowerShell 命令。

下列命令需要 SharePoint 伺服器陣列管理員成員資格,該命令會設定 SharePoint 內部部署伺服陣列的驗證領域。

注意

執行這個命令會變更 SharePoint 內部部署伺服陣列的驗證領域。 對於使用現有 Security Token Service (STS) 的應用程式,這可能會導致其他使用存取 Token 的應用程式出現非預期行為。 其他資訊:Set-SPAuthenticationRealm

Set-SPAuthenticationRealm -Realm $SPOContextId

為 SharePoint 上的 Azure Active Directory 建立信任的安全性權杖簽發者

在 SharePoint 內部部署伺服器的 SharePoint 2013 管理命令介面中,依指定順序執行下列 PowerShell 命令。

下列命令需要 SharePoint 伺服器陣列管理員成員資格。

如需這些 PowerShell 命令的詳細資訊,請參閱在 SharePoint 2013 中使用 Windows PowerShell Cmdlet 管理安全性

  1. 啟用 PowerShell 工作階段,對 SharePoint 伺服陣列的 Security Token Service 進行變更。

    $c = Get-SPSecurityTokenServiceConfig
    $c.AllowMetadataOverHttp = $true
    $c.AllowOAuthOverHttp= $true
    $c.Update()
    
  2. 設定中繼資料端點。

    $metadataEndpoint = "https://accounts.accesscontrol.windows.net/" + $SPOContextId + "/metadata/json/1"
    $acsissuer  = "00000001-0000-0000-c000-000000000000@" + $SPOContextId
    $issuer = "00000007-0000-0000-c000-000000000000@" + $SPOContextId
    
  3. 在 Azure Active Directory 中建立新的 Token 控制服務應用程式 Proxy。

    New-SPAzureAccessControlServiceApplicationProxy -Name "Internal" -MetadataServiceEndpointUri $metadataEndpoint -DefaultProxyGroup
    

    注意

    New- SPAzureAccessControlServiceApplicationProxy 命令可能會傳回錯誤訊息,表示相同名稱的應用程式 Proxy 已經存在。 如果具名應用程式 Proxy 已存在,您可以忽略該錯誤。

  4. 在 Azure Active Directory 的 SharePoint 內部部署中建立新的 Token 控制服務簽發者。

    $ = New-SPTrustedSecurityTokenIssuer –Name "ACSInternal" –IsTrustBroker:$true –MetadataEndpoint $metadataEndpoint -RegisteredIssuerName $acsissuer 
    

授與 Microsoft Dynamics 365 權限以存取 SharePoint,並設定宣告型驗證對應

在 SharePoint 內部部署伺服器的 SharePoint 2013 管理命令介面中,依指定順序執行下列 PowerShell 命令。

下列命令需要 SharePoint 網站集合管理成員資格。

  1. 向 SharePoint 網站集合註冊 Microsoft Dynamics 365。

    輸入 SharePoint 內部部署網站集合 URL。 在此範例中,使用 *https://sharepoint.contoso.com/sites/crm/*。

    重要

    若要完成此命令,SharePoint 應用程式管理服務應用程式 Proxy 必須存在且正在執行。 如需如何啟動和設定服務的詳細資訊,請參閱設定 SharePoint 應用程式的環境 (SharePoint 2013) 中的<設定訂閱設定與應用程式管理服務應用程式>副主題。

    $site = Get-SPSite "https://sharepoint.contoso.com/sites/crm/"
    Register-SPAppPrincipal -site $site.RootWeb -NameIdentifier $issuer -DisplayName "crm"
    
  2. 授與 Microsoft Dynamics 365 應用程式存取 SharePoint 網站的權限。 將 https://sharepoint.contoso.com/sites/crm/ 取代成您的 SharePoint 網站 URL。

    注意

    在下列範例中,使用 –Scope 網站集合參數授與 Dynamics 365 應用程式指定 SharePoint 網站集合的權限。 範圍參數接受下列選項。 選擇最適合您的 SharePoint 設定的範圍。

    • site。 將 Dynamics 365 應用程式權限僅授與 SharePoint 網站。 不會將權限授與具名網站下的任何子網站。

    • sitecollection。 將 Dynamics 365 應用程式權限授與所有網站及指定 SharePoint 網站集合中的子網站。

    • sitesubscription。 將 Dynamics 365 應用程式權限授與 SharePoint 伺服器陣列中的所有網站,包括所有網站集合、網站和子網站。

    $app = Get-SPAppPrincipal -NameIdentifier $issuer -Site "https://sharepoint.contoso.com/sites/crm/"
    Set-SPAppPrincipalPermission -AppPrincipal $app -Site $site.Rootweb -Scope "sitecollection" -Right "FullControl"
    
  3. 設定宣告型驗證設定對應類型。

    重要

    根據預設,宣告型驗證對應會使用使用者的 Microsoft 帳號 電子郵件地址以及使用者的 SharePoint 內部部署 [工作電子郵件] 地址進行對應。 當您這樣使用時,使用者的電子郵件地址必須在兩個系統之間相符。 如需詳細資訊,請參閱選擇宣告型驗證設定對應類型。

    $map1 = New-SPClaimTypeMapping -IncomingClaimType "https://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming
    

執行啟用伺服器架構 SharePoint 整合精靈

在 Microsoft Dynamics 365 應用程式中,依照下列步驟執行:

  1. 移至 [設定] > [文件管理]。(要如何達到目標?)

  2. 在 [文件管理] 區域中,按一下 [啟用伺服器架構 SharePoint 整合]。

  3. 檢閱資訊,然後按 [下一步]。

  4. 對於 SharePoint 網站,按一下 [內部部署],然後按 [下一步]。

  5. 輸入 SharePoint 內部部署網站集合 URL,例如 *https://sharepoint.contoso.com/sites/crm*。 該網站必須已設定成使用 SSL。

  6. 按 [下一步]。

  7. 驗證網站區段隨即出現。 如果所有網站皆判定為有效,請按一下 [啟用]。 如果有一個或多個網站判定為無效,請參閱疑難排解伺服器架構驗證

選取要包含在文件管理中的實體

預設會包含客戶、文章、潛在客戶、產品、報價及銷售文宣實體。 您可以在 Microsoft Dynamics 365 的 [文件管理設定] 中,新增或移除文件管理搭配 SharePoint 所使用的實體。移至 [設定] > [文件管理]。(要如何達到目標?)其他資訊:客戶中心:啟用實體的文件管理

新增商務用 OneDrive 整合

完成 Microsoft Dynamics 365 及 SharePoint 內部部署伺服器架構驗證設定之後,您也可以整合商務用 OneDrive。Dynamics 365 使用者可以透過 Microsoft Dynamics 365 與 商務用 OneDrive 整合,使用商務用 OneDrive 建立和管理私人文件。 系統管理員已啟用商務用 OneDrive 後,就可以在 Dynamics 365 中存取這些文件。

啟用商務用 OneDrive

在 SharePoint Server 內部部署執行所在的 Windows Server,開啟 SharePoint 管理命令介面並執行以下命令:

Add-Pssnapin *
# Access WellKnown App principal
[Microsoft.SharePoint.Administration.SPWebService]::ContentService.WellKnownAppPrincipals

# Create WellKnown App principal
$ClientId = "00000007-0000-0000-c000-000000000000"
$PermissionXml = "<AppPermissionRequests AllowAppOnlyPolicy=""true""><AppPermissionRequest Scope=""https://sharepoint/content/tenant"" Right=""FullControl"" /><AppPermissionRequest Scope=""https://sharepoint/social/tenant"" Right=""Read"" /><AppPermissionRequest Scope=""https://sharepoint/search"" Right=""QueryAsUserIgnoreAppPrincipal"" /></AppPermissionRequests>"

$wellKnownApp= New-Object -TypeName "Microsoft.SharePoint.Administration.SPWellKnownAppPrincipal" -ArgumentList ($ClientId, $PermissionXml)

$wellKnownApp.Update()

選擇宣告型驗證設定對應類型

根據預設,宣告型驗證對應會使用使用者的 Microsoft 帳號 電子郵件地址以及使用者的 SharePoint 內部部署工作電子郵件地址進行對應。 請注意,不論您使用何種宣告型驗證類型,Microsoft Dynamics 365 (線上) 和 SharePoint 之間的這些值 (例如電子郵件地址) 都必須相符。Office 365 目錄同步處理對此可以有所幫助。其他資訊:在 Microsoft Azure 中部署 Office 365 目錄同步處理 (DirSync) (機器譯文) 若要使用不同類型的宣告型驗證對應,請參閱定義 SharePoint 伺服器架構整合的自訂宣告對應 (英文)。

重要

若要啟用工作電子郵件屬性,SharePoint 內部部署必須已設定並啟動 User Profile Service 應用程式。 若要在 SharePoint 中啟用 User Profile Service 應用程式,請參閱在 SharePoint Server 2013 中建立、編輯或刪除 User Profile Service 應用程式 (機器譯文)。 若要變更使用者屬性 (例如工作電子郵件),請參閱編輯使用者設定檔屬性 (機器譯文)。 如需 User Profile Service 應用程式的詳細資訊,請參閱SharePoint Server 2013 的 User Profile Service 應用程式概觀 (機器譯文)。

另請參閱

疑難排解伺服器架構驗證
設定 SharePoint 與 Microsoft Dynamics 365 整合

© 2017 Microsoft. 著作權所有,並保留一切權利。 著作權