www.SAMURAJ-cz.com 

19.04.2024 Rostislav Translate to English by Google     VÍTEJTE V MÉM SVĚTĚ

Články

Exchange Server 2016 a integrace se Skype for Business

Neděle, 23.06.2019 10:47 | Samuraj - Petr Bouška |
Článek stručně popisuje propojení Exchange 2016 a Skype for Business 2015. Vychází ze situace, kdy již integrace byla nastavena pro Exchange 2010 a pak došlo k migraci na nové Exchange servery. Získáme tak IM (Instant Messaging) a Presence v Outlook on the web a hlasové funkce (hlasová schránka, hlasový přístup do schránky, automatický pomocník).

Dokumentace

Můj původní popis integrace Microsoft Lync část 7 - Integrace s Exchange serverem.

Oficiální dokumentace obsahuje pouze kusé a nesourodé informace, z kterých se celá integrace dává dohromady těžko.

Konfigurace OAuth - server-to-server authentication

Kontrola, že máme nastavenu a funkční autentizaci mezi servery.

Configure OAuth authentication with SharePoint 2013 and Lync 2013

Configure partner applications in Skype for Business Server and Exchange Server

Autentizace využívá Auth metadata URLs

  • Exchange 2016 - https://<serverfqdn>/autodiscover/metadata/json/1
  • Skype for Business - https://<serverfqdn>/metadata/json/1

Certifikáty pro OAuth

Musí být nastaveny na všech serverech. Na Exchange se vytvoří Self-signed Exchange Server Auth Certificate. Na Skype for Business OAuthTokenIssuer.

Konfigurace partnerské aplikace na Exchange pomocí skriptu

cd "C:\Program Files\Microsoft\Exchange Server\V15\Scripts"
.\Configure-EnterprisePartnerApplication.ps1 -AuthMetaDataUrl https://sfb.firma.local/metadata/json/1 -ApplicationType Lync

[PS] C:\>Get-PartnerApplication

Name               ApplicationIdentifier                Realm     UseAuthServer Enabled
----               ---------------------                -----     ------------- -------
Exchange Online    00000002-0000-0ff1-ce00-000000000000           True          False
Microsoft Graph    00000003-0000-0000-c000-000000000000           True          True
LyncEnterprise-62  00000004-0000-0ff1-ce00-000000000000 firma.cz  False         True

Doporučeno je restartovat IIS

[PS] C:\>iisreset server.firma.local

Konfigurace partnerské aplikace na Skype for Business pomocí cmdletu

New-CsPartnerApplication -Identity Exchange -ApplicationTrustLevel Full -MetadataUrl "https://mail.firma.local/autodiscover/metadata/json/1"

Identity                            : Exchange
AuthToken                           : Value=https://mail.firma.local/autodiscover/metadata/json/1
Name                                : Exchange
ApplicationIdentifier               : 00000002-0000-0ff1-ce00-000000000000
Realm                               : firma.cz
ApplicationTrustLevel               : Full
AcceptSecurityIdentifierInformation : False
Enabled                             : True

Skype for Business test funkčnosti

PS C:\>Test-CsExStorageConnectivity -SipUri "sip:bouska@firma.cz"

Test-CsExStorageConnectivity : ExCreateItem exchange operation failed, code=574, reason=#CTX#{ctx:{traceId:1954436126,
activityId:"ee2a1a4f-e854-4e6a-9c50-72578a00ce3b"}}#CTX#StoreException: code=ErrorUnhandledException, reason=Wrapped ca
llback failed ---> System.InvalidOperationException: Client found response content type of 'text/html', but expected 't
ext/xml'.
The request failed with the error message:
--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Test failed.

Test mi vracel chybu výše, kde byl i HTML kód. To byla stránka z FW ukazující chybu. Navedlo mne fórum Unified Contact Store UCS integration issue - Event Source: LS Storage Service - Event ID: 32043. Problém je, že Skype for Business se připojuje na externí adresu a ne na interní. Skrze FW mi neprocházela potřebná autentizace. Takže jsem do host souboru přidal externí jméno s interní adresou a vše začalo chodit.

PS C:\> Test-CsExStorageConnectivity -SipUri "sip:bouska@firma.cz"
Test passed.

Možno zavolat s přepínačem -verbose.

Nastavený Autodiscover service na Exchange Server

Kontrola funkčnosti Autodiscover služby na Exchange serveru.

Get-ClientAccessServer | Select-Object Name, AutoDiscoverServiceInternalUri | FL

Name                           : MAIL
AutoDiscoverServiceInternalUri : https://mail.firma.local/Autodiscover/Autodiscover.xml

Skype for Business - nastavení Autodiscover, místo Autodiscover.xml se zadává Autodiscover.svc

Set-CsOAuthConfiguration -Identity global -ExchangeAutodiscoverUrl "https://mail.firma.local/Autodiscover/Autodiscover.svc"

Povolení Skype for Business pro Outlook on the Web

Exchange Server

Zjistíme se thumbprint hlavního certifikátu.

[PS] C:\>Get-ExchangeCertificate

Thumbprint                                Services   Subject
----------                                --------   -------
AC74520832111E5F62259B700D1264F0E8AAC052  IP.WS..    CN=mail.firma.cz, OU=IT
E57149B2DA98144955038CD09F24BAEB97388C5B  ....S..    CN=Microsoft Exchange Server Auth Certificate
6D118A0FB5D07299388B17EAD43462DA55515430  .......    CN=WMSvc-SHA2-mail

Zkontrolujeme nastavení OWA.

[PS] C:\>Get-OwaVirtualDirectory -Server mail | FL *inst*

InstantMessagingCertificateThumbprint :
InstantMessagingServerName            :
InstantMessagingEnabled               : True
InstantMessagingType                  : None

Nastavíme hodnoty pro Skype sever.

Get-OwaVirtualDirectory -server mail | Set-OwaVirtualDirectory -InstantMessagingType OCS -InstantMessagingEnabled:$true -InstantMessagingCertificateThumbprint AC74520832111E5F62259B700D1264F0E8AAC052 -InstantMessagingServerName sfb.firma.local
Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -InstantMessagingType OCS -InstantMessagingEnabled $True

Podle oficiálního postupu Configure instant messaging integration with Outlook on the web in Exchange nefunguje nastavení výše, ale musíme použít následující příkaz.

New-SettingOverride -Name "IM Override" -Component OwaServer -Section IMSettings -Parameters @("IMServerName=sfb.firma.local","IMCertificateThumbprint=AC74520832111E5F62259B700D1264F0E8AAC052") -Reason "Configure IM"

Pak musíme na všech Exchange serverech obnovit IM nastavení.

Get-ExchangeDiagnosticInfo -Server mail -Process Microsoft.Exchange.Directory.TopologyService -Component VariantConfiguration -Argument Refresh

A restartovat IIS Pool pro Outlook on the web.

Restart-WebAppPool MSExchangeOWAApppool

Pro kontrolu, že došlo k nastavení hodnot, můžeme použít příkaz.

[xml]$diag=Get-ExchangeDiagnosticInfo -Server mail -Process MSExchangeMailboxAssistants -Component VariantConfiguration -Argument "Config,Component=OwaServer"; $diag.Diagnostics.Components.VariantConfiguration.Configuration.OwaServer.IMSettings

EnableIMForOwaPremium   : False
IMServerName            : sfb.firma.local
IMCertificateThumbprint : AC74520832111E5F62259B700D1264F0E8AAC052
IMPortNumber            : -1
LyncIMSyncLogEnabled    : True

Případně zobrazit

[PS] C:\>Get-OwaVirtualDirectory | FL *inst*

InstantMessagingCertificateThumbprint : AC74520832111E5F62259B700D1264F0E8AAC052
InstantMessagingServerName            : sfb.firma.local
InstantMessagingEnabled               : True
InstantMessagingType                  : Ocs

Skype for Business server

Nejprve jsem zkusil pouze upravit existující nastavení, ale Outlook on the Web hlásil chybu. Pak jsem smazal stará nastavení Skype for Business (Get-CsTrustedApplicationComputer, Get-CsTrustedApplication, Get-CsTrustedApplicationPool) a nově nastavil dle postupu níže.

Outlook on the Web chyba integrace Skype for Business

Zjistíme info o Site

PS C:\>Get-CsSite | Select-Object DisplayName, SiteID

DisplayName                                                 SiteId
-----------                                                 ------
Praha                                                       1

Vytvoříme Trusted Application Pool

New-CsTrustedApplicationPool -Identity mail.firma.local -Registrar sfb.firma.local -Site Praha -RequiresReplication $False

Přidáme Trusted Application do Trusted Application Pool. Port si volíme unikátní pro každou aplikaci.

New-CsTrustedApplication -ApplicationId OutlookWebApp -TrustedApplicationPoolFqdn mail.firma.local -Port 6000

Publikujeme topologii.

Enable-CsTopology

Poté již můžeme otestovat Outlook on the Web.

Outlook on the Web funkční integrace Skype for Business

Unified Messaging integrace

Exchange server

Nejprve je třeba vytvořit UM Dial Plan, ale při migraci jej již máme.

Dále nastavujeme UM Services

[PS] C:\>Set-UMService -Identity mail.firma.local -Dialplans DialPlan -UMStartupMode Dual

WARNING: Changes to UMStartupMode will only take effect after the Microsoft Exchange Unified Messaging service is restarted
 on server mail. The Microsoft Unified Messaging service won't start unless there is a valid TLS certificate.
WARNING: To complete TLS setup, do all of the following: (1) Create a new certificate using the New-ExchangeCertificate
 cmdlet (2) Associate this certificate with the server using the Enable-ExchangeCertificate cmdlet (3) For self-signed
 certificates, copy this certificate to the UM IP gateway and  correctly import it. For CA-signed certificates, correctly
 import the CA certificate to the UM IP gateway.

Musíme přiřadit certifikát k UM službě

Exchange přiřazení certifikátu k UM službě

Dostaneme informaci, že je třeba restart služby Microsoft Exchange Unified Messaging - MSExchangeUM

Nastavíme UM Call Router

[PS] C:\>Set-UMCallRouterSettings -Server mail -UMStartupMode Dual -DialPlans DialPlan

WARNING: Changes to UMStartupMode will only take effect after the Microsoft Exchange Unified Messaging Call Router service
 is restarted on server mail. The Microsoft Unified Messaging CallRouter service won't start unless there is a valid TLS
 certificate.
WARNING: To complete TLS setup, do all of the following: (1) Create a new certificate using the New-ExchangeCertificate
 cmdlet (2) Associate this certificate with the server using theEnable-ExchangeCertificate cmdlet (3) For self-signed
 certificates, copy this certificate to the UM IP gateway and  correctly import it. For CA-signed certificates, correctly
 import the CA certificate to the UM IP gateway.

Nastavíme certifikát

[PS] C:\>Enable-ExchangeCertificate -Server mail -Thumbprint AC74520832111E5F62259B700D1264F0E8AAC052 -Services UMCallRouter

Confirm
Enable certificate with thumbprint AC74520832111E5F62259B700D1264F0E8AAC052 for Unified Messaging Call Router?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y
WARNING: To complete configuration (1) Restart Microsoft Exchange Unified Messaging Call Router Service on mail and (2) For
 self-signed certificates, install this certificate on the UM IP Gateway. For CA-signed certificates, import the CA
 certificate on the UM IP Gateway.

Restart komponenty UM Call Router

[PS] C:\>Restart-Service MSExchangeUMCR

WARNING: Waiting for service 'Microsoft Exchange Unified Messaging Call Router (MSExchangeUMCR)' to start...

Použití Exchange UC Configuration Script

[PS] C:\Program Files\Microsoft\Exchange Server\V15\Scripts>.\ExchUCUtil.ps1

Skype for Business

Protože provádíme migraci, tak není potřeba znovu spouštět skript, ale můžeme případně zkontrolovat nastavení.

C:\Program Files\Common Files\Skype for Business Server 2015\Support\OcsUmUtil.exe

Skype for Business a Unified Contact Store

Configure Skype for Business Server to use the unified contact store, Planning and deploying unified contact store in Lync Server 2013

Unified Contact Store (UCS) je společný seznam kontaktů pro Skype for Business klienta, Outlook a Outlook on the web. Standardně jsou SfB kontakty uloženy na SfB serveru. Po nastavení UCS se kontakty přesunou na Exchange a pro přístup se využívá EWS. Nastavení znamená vytvoření nebo upravení politiky a nastavení na uživatele.

New-CsUserServicesPolicy -Identity Allowed-UCS -UcsAllowed $True
Grant-CsUserServicesPolicy -Identity bouska -PolicyName Allowed-UCS

Ukládání historie konverzací a propojení SfB klienta na Exchange

klientovi Skype for Business můžeme nastavovat integraci s Exchange a Outlook. Nastavení je v menu Tools - Options - Personal. Hlavní položky jsou sdílení kontaktů a ukládání historie konverzací.

Skype for Business klient nastavení integrace Exchange a Outlook

Integrace s Outlookem funguje tak, že se využívá COM Add-in Conversation History Add-in. Podle informací na internetu se Skype for Business klient nejprve snaží použít Exchange Web Services (EWS). V případě potíží zkusí MAPI spojení pomocí Outlook klienta, které má omezené funkce.

Jakou konfiguraci má Skype for Business klient se můžeme podívat, když klikneme Ctrl + pravé tlačítko myši na ikonu Skype for Business v oznamovací oblasti (vedle hodin) a zvolíme Configuration Information.

Mohou nastat situace, kdy spojení na Exchange server (nebo Outlook) nefunguje. Skype for Business klient pak zobrazí v pravém dolním rohu nebo u ikon událostí (historie a schůzky) výstrahu. A i když výstraha po nějaké době zmizí, tak se nezobrazilo nic v Conversations (historii konverze) a Meetings (kalendář).

Skype for Business klient chyba integrace 1
Skype for Business klient chyba integrace 2
Skype for Business klient chyba integrace 3

Našel jsem informaci, že  Skype for Business klient, pro nalezení adresy EWS, nepoužívá Autodiscover SCP, ale pouze Autodiscover DNS záznam. A i v interní síti použije externí adresu EWS. Takže ve chvíli, kdy se klient z interní sítě nemůže připojit na externí EWS (nebo se nemůže autentizovat), tak zobrazí chybu. V mém případě jsem vyřešil interními DNS záznamy, které externí adresy Exchange směrují na interní servery. Okamžitě se v SfB klientovi zobrazily chybějící záznamy.

zobrazeno: 7295krát | Komentáře [0]

Autor:

Související články:

Migrace Exchange organizace 2010 na 2016

Prováděl jsem migraci organizace z Exchange Server 2010 na Exchange Server 2016. Celý proces byl dost náročný a dlouhý (i se studiem mi trval 4 měsíce). V průběhu jsem narazil na množství problémů, chyb a nedostatků (i v oficiální dokumentaci). Ze svých poznámek vytvářím tuto sérii. Nejde o kompletní návod na přechod, ale o hlavní body a zmínky problémů, na které jsem narazil. Jednotlivé články popisují různé oblasti Exchange Server 2016, takže nejde pouze o přechod ze starší verze, ale hodí se i pro novou instalaci či správu.

Microsoft Exchange

Jednou částí mé práce je administrace poštovního serveru od firmy Microsoft, tedy Exchange Serveru. Články začínají u verze 2003 a jak jde čas, tak pokračují dále.

Pokud se chcete vyjádřit k tomuto článku, využijte komentáře níže.

Komentáře

Zatím tento záznam nikdo nekomentoval.

Přidat komentář

Vložit tag: strong em link

Vložit smajlík: :-) ;-) :-( :-O

Nápověda:
  • maximální délka komentáře je 2000 znaků
  • HTML tagy nejsou povoleny (budou odstraněny), použít se mohou pouze speciální tagy (jsou uvedeny nad vstupním polem)
  • nový řádek (ENTER) ukončí odstavec a začne nový
  • pokud odpovídáte na jiný komentář, vložte na začátek odstavce (řádku) číslo komentáře v hranatých závorkách