Teams Calendar Tab and Delegation


Bon, ça faisait longtemps et j’avoue que cela ne me manquait pas mais j’ai dû me replonger dans les problèmes légèrement compliqué de Teams Calendrier Tab . Alors pour ceux qui ne seraient pas au courant l’application Teams Calendar tab permet un client Teams d’aller accéder au calendrier d’une boîte aux lettres Exchange stockés sur un serveur On Premise. Donc théorie ça paraît simple mais sa mise en pratique est assez compliquée. J’ai d’ailleurs à ce propos traduit la seule documentation disponible et qui a été réalisée par un MVP Thomas Stensitzki que je remercie ici . Cette documentation vous aidera notamment dans vos investigations si vous avez besoin de monter cette fonctionnalité.

Bon quoi qu’il en soit au bout de quelques jours de travail voire les articles sur mon blog, j’ai pu mettre en place Teams Calendar Tab.

Well, it’s been a long time and I admit that I didn’t miss it but I had to dive back into the slightly complicated problems of Teams Calendar Tab . So for those who don’t know, the Teams Calendar tab application allows a Teams client to access the calendar of an Exchange mailbox stored on an On Premise server. So in theory it seems simple but its implementation is quite complicated. I have translated the only documentation available on this subject and which was made by an MVP Thomas Stensitzki whom I thank here 😉. This documentation will help you in particular in your investigations if you need to mount this feature..

Anyway, after a few days of work, see the articles on my blog, I was able to set up Teams Calendar Tab.

 

Seulement j’avais oublié un détail qui était la délégation de calendrier. / Only I had forgotten one detail which was the calendar delegation.

Explication : Prenons le scénario suivant ou un manager que l’on va appeler « boss », donne une délégation de calendrier à son « assistant ».Jusque-là rien de très anormal. mais cet assistant à travers son client Outlook va planifier une réunion pour son boss en y incluant, grâce au plug in un lien Microsoft Teams. Et là c’est le drame.

Explanation: Let’s take the following scenario where a manager, whom we will call « boss », gives a calendar delegation to his « assistant ». So far, nothing very abnormal. But this assistant, through his Outlook client, will plan a meeting for his boss by including, thanks to the plug in, a Microsoft Teams link. And then it’s a tragedy.


Naturellement j’ai pris soin de vérifier avant que le boss et l’assistant à travers leurs clients teams avaient bien accès à leur calendrier. / Of course I took care to check beforehand that the boss and the assistant through their client teams had access to their calendar.

Ce qui permet de vérifier que l’accès aux web services Exchange on Premise par l’application Teams fonctionne : Et c’est là où les choses vont se corser. / This verifies that access to Exchange on Premise web services through the Teams application works: And this is where things get tricky.

Je vais donc indiquez ici tout ce que vous devez faire pour faire en sorte que cela fonctionne / So I’m going to outline here everything you need to do to make this work

Contexte

Afin de faciliter le diagnostic j’ai entrepris de mettre en place cela sur une maquette extrêmement simple dépourvue de répartiteurs de charges dépourvue de firewall dépourvue de proxy et cetera et cetera. L’idée était de voir si avec un environnement extrêmement simple et très permissif la solution de délégation fonctionnait. Bonne force est de constater qu’avec un nouvel environnement ce n’est pas le cas. On est donc parti pour chercher un peu. Pour cela je vais donc suivre les recommandations de Thomas Stensitzki qui sont les suivantes :

In order to make the diagnosis easier, I set up a very simple model without load balancers, without firewalls, without proxies and so on and so forth. The idea was to see if with an extremely simple and very permissive environment the delegation solution worked. However, it is clear that with a new environment this is not the case. So we went to look for a bit. For that I will follow the recommendations of Thomas Stensitzki which are the following:

Troubleshooting Microsoft Teams and Calendar Delegates/ Dépannage des déléguations de Microsoft Teams et Calendar

 

Note : English version is here : https://techcommunity.microsoft.com/t5/microsoft-teams-community-blog/microsoft-teams-and-on-premises-mailboxes-part-3-calendar-based/ba-p/2235211

  1. L’application Calendrier affiche votre calendrier pour planifier des réunions ou des réunions en direct. Si vous souhaitez qu’un délégué crée une réunion Teams en votre nom, il doit planifier la réunion dans Outlook for desktop si les deux utilisateurs disposent de boîtes aux lettres sur site. Vous ne pouvez planifier une nouvelle réunion Teams que si l’add-in Microsoft Teams est disponible dans Outlook.
  2. Une autre condition préalable essentielle est que vous, en tant que gestionnaire de la boîte aux lettres, accordiez aux délégués un accès avec des droits d’édition via l’assistant de configuration d’Outlook pour les délégués. L’attribution de droits de dossier sur le dossier du calendrier n’est pas suffisante.
  3. La création d’une nouvelle réunion d’équipe par un délégué pour une boîte aux lettres de gestionnaire dans une organisation Exchange sur site utilise également le point de terminaison Exchange Web Services. La création d’une nouvelle réunion par un délégué s’effectue selon les étapes suivantes :
  • Le délégué sélectionne le calendrier des managers dans Outlook for Desktop et clique sur Nouvelle réunion d’équipe dans le ruban.

  • Le module d’extension Teams se connecte aux services dorsaux de Teams et interroge les autorisations de délégués pour la boîte aux lettres du manager.
  • Les services Teams Backend utilisent AutoDiscover V2 pour obtenir l’URL EWS.
  • Les services dorsaux Teams établissent une connexion authentifiée OAuth au répertoire virtuel /EWS du serveur Exchange sur site.
  • Les services dorsaux Teams envoient une requête SOAP GetDelegate pour créer la réunion Teams dans la boîte aux lettres du gestionnaire.
  • Le serveur Exchange renvoie la liste des délégués de boîte aux lettres configurés et les autorisations correspondantes pour la boîte aux lettres.
  • Les services dorsaux Teams envoient les informations relatives à la réunion Teams en tant que réponse à l’extension Teams Outlook, qui ajoute les informations à la demande de réunion Outlook.

Si vous rencontrez des problèmes pour créer une nouvelle invitation à une réunion Teams en tant que délégué, vous pouvez vérifier les points suivants :

  • L’application de calendrier Teams fonctionne-t-elle comme prévu pour le manager et le délégué ?
  • Exécutez une requête GetDelegate à l’aide d’un client SOAP, c’est-à-dire SOAPe.
  • Encore une fois, utilisez Fiddler pour un dépannage supplémentaire au niveau du protocole.

– Vous recevez une notification d’erreur Teams

  • Vérifiez l’autorisation du délégué, car les autorisations directes de dossier ne sont pas suffisantes.
  • You receive a Teams error notification that a connection to the server is not possible

  • Vous recevez une notification d’erreur Teams indiquant qu’une connexion au serveur n’est pas possible
    • Vérifiez le journal du protocole EWS pour la requête GetDelegate.
    • Vérifiez les journaux IIS Frontend et EWS-Proxy pour les connexions Teams Backend.
    • Vérifiez la configuration de l’application partenaire d’Exchange Server.

       

Une autre source d’erreur pour les problèmes de connexion aux terminaux Exchange Server est le filtrage des chaînes d’agents utilisateurs. Si vous utilisez des périphériques réseau de couche 7 qui effectuent ce type de filtrage, configurez-les pour qu’ils soient contournés.

Diagnostics

Examen des journaux EWS / Review of EWS logs

Avec Notepad++ je recherche le terme GetDelegate dans les journaux EWS C:\Program Files\Microsoft\Exchange Server\V15\Logging\Ews. Aucune trace sur les deux serveurs Mailbox de méthode GetDelegate dans les log EWS. Ca commence bien ! / With Notepad++ I search for the term GetDelegate in the EWS logs C:\Program Files\Microsoft\Exchange Server\V15\Logging\Ews. No trace on the two Mailbox servers of GetDelegate method in the EWS logs. It starts well !

Ca m’inquiète un peu car je rappelle que sur cette maquette les Webservices Exchange 2016 fonctionnent correctement car sinon je n’aurais pas le calendrier dans les clients Teams, et que la station de travail ainsi que tous les serveurs Exchange sortent en direct sur internet. Et coté publication (Internet vers les serveurs Exchange) aucun filtrage n’est effectué / It worries me a little because I recall that on this model the Exchange 2016 Webservices are working properly because otherwise I would not have the calendar in the Teams clients, and that the workstation and all the Exchange servers go out live on the Internet. And on the publishing side (Internet to Exchange servers) no filtering is done

 

Examen des journaux avec Fiddler

Bon après avoir installé fiddler, le client Teams ne peux pas se connecter , et visiblement je ne suis pas le seul, / Well, after installing fiddler, the Teams client can’t connect, and obviously I’m not the only one

https://feedback.telerik.com/fiddler/1479071-fiddler-refusing-to-ignore-teams-microsoft-com-and-is-causing-my-ms-teams-app-on-windows-to-break

https://www.telerik.com/forums/cannot-sign-back-to-office-365-when-fiddler-is-running

https://community.getfiddler.com/support/discussions/topics/12000027001

https://stackoverflow.com/questions/14734329/when-running-fiddler-outlook-stops-working-how-do-i-fix-this

Si l’on se connecte à Microsoft Teams et qu’on lance fiddler après alors on obtient un autre message d’erreur que nous n’avons pas en temps normal… / if we connect to Microsoft Teams and then launch fiddler we get another error message that we don’t normally get…

 

Récupération des journaux Teams

Pour récupérer les journaux Teams il faut appuyer sur Windows: Ctrl + Alt + Shift + 1. J’ai ensuite recherché dans les journaux Web généré par Microsoft Teams / To retrieve the Teams logs you have to press Windows: Ctrl + Alt + Shift + 1. I then searched in the Web logs generated by Microsoft Teams

Et voici ce que j’ai trouvé / And this is what I found

 

En regardant le contexte de la première ligne voici ce que je peux constater dans le journal / Looking at the context of the first line here is what I can see in the log

  • .Teams.MeetingAddin.Controller.RibbonController CreateMeeting Creating new appointment from Inspector, with origin: Appointment_NewMeetingButton
  • 2022-01-14-11:37:24.211 AM 4 Info Microsoft.Teams.MeetingAddin.Controller.RibbonController CreateMeeting AppointmentItem ICalUID: 040000008200E00074C5B7101A82E0080000000030E472193B09D8010000000000000000100000003AEAECAA77684848B166FFB4A54C4332
  • 2022-01-14-11:37:24.211 AM 4 Info AppointmentItemExtensions IsSfbMeeting Entry
  • 2022-01-14-11:37:24.211 AM 4 Error AppointmentItemExtensions GetStringProperty Failed to read property OnlineMeetingExternalLink
  • System.Runtime.InteropServices.COMException (0x8004010F): The property « http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OnlineMeetingExternalLink » is unknown or cannot be found.
  • at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName)
  • at Microsoft.Teams.MeetingAddin.Model.AppointmentItemExtensions.GetStringProperty(AppointmentItem item, String propertyName)
  • 2022-01-14-11:37:24.211 AM 4 Info AppointmentItemExtensions GetStringProperty Read property OnlineMeetingExternalLink Value=
  • 2022-01-14-11:37:24.211 AM 4 Error AppointmentItemExtensions GetStringProperty Failed to read property OnlineMeetingConfLink
  • System.Runtime.InteropServices.COMException (0x8004010F): The property « http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OnlineMeetingConfLink » is unknown or cannot be found.
  • at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName)
  • at Microsoft.Teams.MeetingAddin.Model.AppointmentItemExtensions.GetStringProperty(AppointmentItem item, String propertyName)
  • 2022-01-14-11:37:24.211 AM 4 Info AppointmentItemExtensions GetStringProperty Read property OnlineMeetingConfLink Value=
  • 2022-01-14-11:37:24.235 AM 4 Info Microsoft.Teams.MeetingAddin.View.MeetingView Register Entry
  • 2022-01-14-11:37:24.235 AM 4 Info Microsoft.Teams.MeetingAddin.Controller.RibbonController CreateOrGetMeetingView Created a new meeting view 29713416 for inspector 6087314
  • 2022-01-14-11:37:24.289 AM 4 Info Microsoft.Teams.MeetingAddin.Controller.MeetingController CreateMeeting Entry
  • 2022-01-14-11:37:24.289 AM 4 Info Microsoft.Teams.MeetingAddin.Controller.MeetingController ShouldShowAccountMismatchDialog Entry
  • 2022-01-14-11:37:24.289 AM 4 Info Microsoft.Teams.MeetingAddin.Settings.SettingsBase Lookup Returning default value False for EnableTeamsAccountComparison setting
  • 2022-01-14-11:37:24.347 AM 4 Info AppointmentItemExtensions IsSfbMeeting Entry
  • 2022-01-14-11:37:24.347 AM 4 Error AppointmentItemExtensions GetStringProperty Failed to read property OnlineMeetingExternalLink
  • System.Runtime.InteropServices.COMException (0x8004010F): The property « http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OnlineMeetingExternalLink » is unknown or cannot be found.
  • at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName)
  • at Microsoft.Teams.MeetingAddin.Model.AppointmentItemExtensions.GetStringProperty(AppointmentItem item, String propertyName)
  • 2022-01-14-11:37:24.347 AM 4 Info AppointmentItemExtensions GetStringProperty Read property OnlineMeetingExternalLink Value=
  • 2022-01-14-11:37:24.347 AM 4 Error AppointmentItemExtensions GetStringProperty Failed to read property OnlineMeetingConfLink
  • System.Runtime.InteropServices.COMException (0x8004010F): The property « http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OnlineMeetingConfLink » is unknown or cannot be found.
  • at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName)
  • at Microsoft.Teams.MeetingAddin.Model.AppointmentItemExtensions.GetStringProperty(AppointmentItem item, String propertyName)
  • 2022-01-14-11:37:24.347 AM 4 Info AppointmentItemExtensions GetStringProperty Read property OnlineMeetingConfLink Value=
  • 2022-01-14-11:37:24.347 AM 4 Info Microsoft.Teams.MeetingAddin.Settings.SettingsBase Lookup Returning default value False for EnableSkypeToTeamsMeetingConversion setting
  • 2022-01-14-11:37:24.347 AM 4 Error AppointmentItemExtensions GetStringProperty Failed to read property SkypeTeamsMeetingUrl
  • System.Runtime.InteropServices.COMException (0x8004010F): The property « http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SkypeTeamsMeetingUrl » is unknown or cannot be found.
  • at Microsoft.Office.Interop.Outlook._PropertyAccessor.GetProperty(String SchemaName)
  • at Microsoft.Teams.MeetingAddin.Model.AppointmentItemExtensions.GetStringProperty(AppointmentItem item, String propertyName)
  • 2022-01-14-11:37:24.347 AM 4 Info AppointmentItemExtensions GetStringProperty Read property SkypeTeamsMeetingUrl Value=
  • 2022-01-14-11:37:24.347 AM 4 Info Microsoft.Teams.MeetingAddin.Model.MeetingModel .ctor This is not an existing teams meeting. Creating new one
  • 2022-01-14-11:37:24.347 AM 4 Info Microsoft.Teams.MeetingAddin.Model.MeetingModel CreateInternal Entry
  • 2022-01-14-11:37:24.357 AM 4 Info Microsoft.Teams.MeetingAddin.Model.MeetingModel CreateMeetingRequest Creating a meeting for iCalUID: 040000008200E00074C5B7101A82E0080000000030E472193B09D8010000000000000000100000003AEAECAA77684848B166FFB4A54C4332
  • 2022-01-14-11:37:24.357 AM 4 Warn Microsoft.Teams.MeetingAddin.Model.MeetingModel getRecipientAddress Recipient 00000000DCA740C8C042101AB4B908002B2FE18201000000000000002F4F3D4649525354204F5247414E495A4154494F4E2F4F553D45584348414E47452041444D494E4953545241544956452047524F5550202846594449424F484632335350444C54292F434E3D524543495049454E54532F434E3D43464534364141314332334334414638393235463333343939383445463239412D424F535300 is not sendable. Skipping
  • 2022-01-14-11:37:24.357 AM 4 Info Microsoft.Teams.MeetingAddin.Settings.SettingsBase Lookup Returning default value True for EnableOnBehalfofV2 setting
  • 2022-01-14-11:37:24.357 AM 4 Info AppointmentItemExtensions IsDelegating Delegate meeting was found for a non REST shared calendar
  • 2022-01-14-11:37:24.398 AM 4 Info AppointmentItemExtensions IsItemCreatedFromO365GroupCalendar Is item created from O365 group calendar: False
  • 2022-01-14-11:37:24.407 AM 4 Info Microsoft.Teams.MeetingAddin.Model.OwnerResolverUsingGetOrganizer GetUserSmtp Entry

 

After reading some articles I checked my meeting policy as follow. The boss and assistant account have this policy enabled . Après avoir lu quelques articles, j’ai vérifié ma politique de réunion comme suit. Le patron et le compte assistant ont cette politique activée

I found also in the log some information [webAccountId:iM1Sk4x0Jmmtmfb0cZjx1gdi5mM8v3a3uRuVquAytW0][HomeUserUpn:Assistant@cloudmenow.net][LoggedInOnce:1][allowPrivateMeetNow:true][currentTeamsAddinVersion:1.0.21264.3][minStableTeamsAddinEMOVersion:1.0.20275.4][currentTeamsDeepLinkUrlProtocolVersion:1.0.0.0][minStableTeamsDeepLinkUrlProtocolVersion:1.0.0.0]

Aprés quelques recherche je suis tombé sur ca / After some research I found this : https://docs.microsoft.com/en-us/microsoftteams/exchange-teams-interact#requirements-to-create-and-view-meetings-for-mailboxes-hosted-on-premises

To enable calendar delegation for these users: You must also complete steps as described in Configure Integration and OAuth between Skype for Business Online and Exchange Server; these steps will provide the Teams scheduling application the required permissions to confirm delegate permissions.

Et ca clairement je ne l’ai pas fait / And that clearly I didn’t do 😉

Configure Integration and OAuth between Skype for Business Online and Exchange Server

J’ai donc ensuite suivi cette procedure https://docs.microsoft.com/en-us/skypeforbusiness/deploy/integrate-with-exchange-server/oauth-with-online-and-on-premises en tapant les commandes powershell suivantes

I then followed this procedure https://docs.microsoft.com/en-us/skypeforbusiness/deploy/integrate-with-exchange-server/oauth-with-online-and-on-premises by typing the following powershell commands

 

# Create a new Mail User account for the Skype for Business Online Partner Application
$user = New-MailUser -Name SfBOnline-ApplicationAccount -ExternalEmailAddress SfBOnline-ApplicationAccount@cloudmenow.net -DomainController WIN2K16-DC1-01.LT01.LOC
Set-MailUser -Identity $user.Identity -HiddenFromAddressListsEnabled $True -DomainController WIN2K16-DC1-01.LT01.LOC

# These next two commands will assign the UserApplication and ArchiveApplication management role to this new account.
New-ManagementRoleAssignment -Role UserApplication -User $user.Identity -DomainController WIN2K16-DC1-01.LT01.LOC
New-ManagementRoleAssignment -Role ArchiveApplication -User $user.Identity -DomainController WIN2K16-DC1-01.LT01.LOC

 

#Create a new partner application and will use the account
New-PartnerApplication -Name SfBOnline -ApplicationIdentifier 00000004-0000-0ff1-ce00-000000000000 -Enabled $True -LinkedAccount $user.Identity

#Create and enable a Partner Application for Skype for Business Online
# Export the on-premises authorization certificate
# Run a PowerShell script to export the on-premises authorization certificate, which you will import to your Skype for Business Online organization in the next step.
# Save the following text to a PowerShell script file named, for example, ExportAuthCert.ps1.

$thumbprint = (Get-AuthConfig).CurrentCertificateThumbprint
if((test-path $env:SYSTEMDRIVE\OAuthConfig) -eq $false)
{
md $env:SYSTEMDRIVE\OAuthConfig
}
cd $env:SYSTEMDRIVE\OAuthConfig
$oAuthCert = (dir Cert:\LocalMachine\My) | where {$_.Thumbprint -match $thumbprint}
$certType = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert
$certBytes = $oAuthCert.Export($certType)
$CertFile = « $env:SYSTEMDRIVE\OAuthConfig\OAuthCert.cer »
[System.IO.File]::WriteAllBytes($CertFile, $certBytes)

 

#Upload the on-premises authorization certificate to Azure Active Directory ACS
#Save the following text to a PowerShell script file named, for example, UploadAuthCert.ps1

Connect-MsolService;
#Import-Module msonlineextended; Should me ingnored
$CertFile = « $env:SYSTEMDRIVE\OAuthConfig\OAuthCert.cer »
$objFSO = New-Object -ComObject Scripting.FileSystemObject;
$CertFile = $objFSO.GetAbsolutePathName($CertFile);
$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
$cer.Import($CertFile);
$binCert = $cer.GetRawCertData();
$credValue = [System.Convert]::ToBase64String($binCert);
$ServiceName = « 00000004-0000-0ff1-ce00-000000000000 »;
$p = Get-MsolServicePrincipal -ServicePrincipalName $ServiceName
New-MsolServicePrincipalCredential -AppPrincipalId $p.AppPrincipalId -Type asymmetric -Usage Verify -Value $credValue

 

# After you start the script, a credentials dialog box is displayed. Enter the credentials for the tenant administrator account of your Microsoft Online Azure AD organization. After running the script, leave the Windows PowerShell for Azure AD session open. You will use this to run a PowerShell script in the next step.

#Verify that the Certificate has Uploaded to the Skype for Business Service Principal
Get-MsolServicePrincipalCredential -AppPrincipalId 00000004-0000-0ff1-ce00-000000000000


And the result is … working !!!


 

 

 

Votre commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l’aide de votre compte WordPress.com. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l’aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s