Description:

This article describes how an ePaper server can be connected to Office 365 using modern authentication in order to show appointments in Office 365 on ePaper displays.

Please note, that LANCOM Systems cannot perform troubleshooting for such a scenario as an analysis of the external systems (Microsoft Azure and Office 365) is not possible.

The  ePaper server was discontinued in January 2024  (End of Sale). Therefore LANCOM Systems will not provide support for new installations of the  ePaper server. LANCOM Systems will provide support for existing ePaper server installations up to and including January 2026.


Requirements:

  • Access to Office 365
  • Access to the Office 365 admin account
  • An Office 365 user account must be available that can be entered as a mailbox delegate in all of the required room mailboxes.
    • The room mailboxes need to be created as resource mailboxes.
  • Installed and functional ePaper scenario
  • The ePaper server must be installed on a Windows system
  • Windows PowerShell as of version 7.0 must be available on the Windows system where the Python scripts are executed
  • Current web browser with Java Script support as the default browser
  • Python from version 3.4


Procedure:

1) Preparation in Microsoft Azure:

Access to Office 365 is implemented in the background via Microsoft Azure, so whenever the system uses Office 365, it also needs access to Microsoft Azure. Some settings must be made in Microsoft Azure in order for the ePaper server to connect to Office 365.

1.1) Use the following link to log into Microsoft Azure.

https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade

1.2) Select the Office 365 administrator account and log in. 

Illustration of characters or icons labeled 'BFMicrosoft toons' possibly related to a software feature or user interface.

1.3) Under App registrations click on New registration to connect an application to Azure.

Screenshot of a user interface showing the 'Home' section and 'App registrations' menu.

1.4) Modify the following parameters and then click Register:

  • Name: Enter a descriptive name for the application (in this example ePaper Office 365).
  • Supported account types: Select the option Accounts in any organizational directory and personal Microsoft accounts.
  • Redirect URI: Make sure that Web is selected and enter the following link:

Screenshot of a registration interface for an application showing options for account types within a single tenant organizational directory.

1.5) In the Overview, copy the Application (client) ID and save it in a text file for later use.

Screenshot of a technical configuration menu with options for authentication, directory management, and application settings.

1.6) Switch to the tab Certificates & secrets and click on New client secret to generate a key for communicating with Office 365.

Image of a complex technical user interface displaying options for managing certificates, secrets, and configurations, with partial text and icons visible.

1.7) Modify the following parameters and then click Add:

  • Description: Enter a descriptive name for the new key.
  • Expires: From the drop-down menu, select a validity period (in this example 24 months).

After the validity expires, a new key must be created and stored in the Python scripts (see steps 2.2 and 2.3).

A screenshot showing the option to add a client secret in a software configuration menu.

1.8) Copy the Secret key (value) and save it in a text file for later use. 

The secret key must be copied at this time, as this is subsequently no longer possible. In this case the key must be deleted and a new one created.

Screenshot of a technical user interface displaying options for ePaper Office certificates, client secrets, and federated credentials, along with fields for authentication and token configuration.

1.9) Change to the API permissions tab and click on Add a permission.

Screenshot of an ePaperOfficeSAPI permissions overview screen, detailing changes to end-user consent for newly registered multi-tenant apps without verified publishers, including permission types and admin consent requirements.

1.10) Click on Microsoft Graph.

1.11) Choose Delegated permissions.

A screenshot showing a user interface for configuring API permissions in Microsoft Graph, with options to specify the type of permissions an application requires.

1.12) Select the following permissions and then click Add permissions:

  • OpenId permissions:
    • offline_access
  • Calendars:
    • Calendars.Read
    • Calendars.Read.Shared
  • User:
    • User.Read (selected by default)

Screenshot of a technical configuration menu with partial, unclear text and settings options.

Image showing a partially visible user interface with various configuration options related to calendar sharing, possibly from a software application or digital tool.

Image of a blurred or distorted technical user interface screen with partially obscured and unreadable text.

Generischer Alt-Text für Bild

1.13) The permissions should appear as shown below.

Screenshot of a digital interface displaying administrative permissions settings for LANCOM Systems, including details on delegated permissions types and their consent statuses.

1.14) This concludes the preparations in Microsoft Azure.



2) Adapting the supplied script files:

For the connection to work, the login data has to be stored in the Python scripts and information about the ePaper server has to be stored in the configuration file. Furthermore, the ePaper template has to be copied to the installation directory of the ePaper server, unless you use a customized template.

To do this, download the file in the attachment ePaper-Office 365-Scripts.zip and unzip it.

ePaper-Office 365-Scripts.zip


2.1) Copy the ePaper template into the installation directory of the ePaper server:

Skip this step if you are already using a customized template.

Copy the ePaper template lcsconference_landscape.xsl and add this to the installation directory of the ePaper server (Default: C:\Program Files (x86)\LANCOM\WePD-Server ) in the folder data → template.


2.2) Adapting the file “O365_Auth.py”:

Edit the file O365_Auth.py in a text editor and, under credentials, add the Application ID (client) copied in step 1.5 and the Secret key (value) copied in step 1.8.

The login data must be entered in single quotes, as shown in the screenshot.

Image showing a partial view of a technical configuration screen with fields for application ID, client secret, key value, and account credentials, including scope settings for calendar access.


2.3) Adapting the file “O365_Update_v3.py” or “O365_Update_24h_v3.py”:

Edit the file O365_Update_v3.py or O365_Update_24h_v3.py in a text editor and adjust the following parameters:

  • credentials: Enter the Application ID (client) copied in step 1.5 and the Secret key (value) copied in step 1.8.
  • tzone: If required, change the time zone.

One of the following scripts is used: O365_Update_v3.py or O365_Update_24h_v3.py.

  • O365_Update_v3.py always shows the next appointment, even if it is not until the next day.
  • O365_Update_24h_v3.py only shows appointments on the same day.

The login data and the time zone must be entered in single quotes, as shown in the screenshot.


2.4) Adapting the file “config.json”:

2.4.1) Edit the file config.json and modify the following parameters:

  • Under wireless_display_server, set the address as the IP address of the ePaper server.
  • Under conference_label enter your preferred template, assuming that you use your own template and have given it a different name.
  • Modify the following parameters under display:
    • o365_room_mailbox: Enter the e-mail address of the required calendar mailbox.
    • display_id: Enter the Display ID of an ePaper Display.
    • display_name: Enter a descriptive name for the ePaper Display.

The parameters must be entered in closing quotation marks, as shown in the screenshot.

Image displaying a configuration menu for a wireless display server, including options for conference label and domain settings.

2.4.2) When using multiple ePaper displays, for each display the selected area in the displays section must be copied and pasted immediately below. The section for each ePaper display has to be separated by a comma from the section for the next display below. The parameters for the other displays must be adapted as described in step 2.4.1.

Screenshot of a technical configuration interface showing settings for a meeting room mailbox titled MeetingroomWuerselen.

2.4.3) For two ePaper displays, see the displays section appears as follows.

A screenshot showcasing a technical configuration interface with fields to set up and label email addresses for meeting rooms in different locations such as Wuerselen and Hamburg.



3) Final steps in the Windows Power Shell on the system with the ePaper server: 

Open the folder containing the Python scripts, open the context menu by right-clicking while holding down the <shift key>, and select Open PowerShell window here.

As an alternative you can also start a Powershell instance and navigate to the script folder.

Screenshot of a software interface showing options such as 'View,' 'Sort by,' and 'Group by' within a configuration menu.


3.1) Installing the Python modules for Office 365: 

3.1.1) Enter the following command: pip install o365

Image showing a computer screen displaying a command line interface where multiple Python packages such as BeautifulSoup, requests, and certifi are being installed and updated via pip.

3.1.2) Enter the command pip install tzdata to connect the IANA timezone database.

A screenshot of a computer interface showing the successful installation of the 'tzdata' package using a pip install command in a scripts directory.


3.2) Installing the ExchangeOnlineManagement module:

3.2.1) Enter the following command: Install-Module ExchangeOnlineManagement

3.2.2) Confirm the query Do you want PowerShellGet to install and import the NuGet provider now? with Y (Yes).

Screenshot of a PowerShell interface displaying a prompt to install and import the NuGet provider for managing packages in a Windows environment.

3.2.3) Confirm the prompt Are you sure you want to install the modules from 'PSGallery'? with Y (Yes).

Image showing a PowerShell script execution window with prompts to install and import the NuGet provider, along with security warnings about installing modules from an untrusted repository.


3.3) Importing the ExchangeOnlineManagement module:

To do this, enter the following command: Import-Module ExchangeOnlineManagement

Screenshot of a computer interface showing file paths related to ePaper Office scripts and Exchange Online Management module import commands.


3.4) Registering the Office 365 administrator account on the ExchangeOnline module:

3.4.1) Enter the command for registering in the following format: Connect-ExchangeOnline -UserPrincipalName <admin@your-domain.com>

Set the <admin@your-domain.com> as the e-mail address of the Office 365 administrator account used in step 1.2.

Image showing a comparison of old PowerShell cmdlets and new, faster, and more reliable Exchange Online cmdlets for managing mailboxes, permissions, and statistics.

3.4.2) In the web browser pop-up window, log into the Administrator account.

The popup window is only displayed correctly if the web browser supports JavaScript.

Screenshot of a Microsoft user login interface with options to enter a password, retrieve a forgotten password, or sign in with another account.


3.5) Displaying the organizer and the subject on the ePaper Displays:

To register, enter the command in the following format: Set-CalendarProcessing -Identity <testroom@your-domain.com> -DeleteSubject $False -AddOrganizerToSubject $False

Set the <testroom@your-domain.com> as the e-mail address of the room mailbox.

Screenshot of a computer interface displaying a directory path and script settings for calendar processing and administrative configurations.


3.6) Generating a token for authenticating the mailbox proxy:

3.6.1) Enter the following command: python O365_Auth.py 

3.6.2) Copy the link under Visit the following url to give consent: and enter it into a web browser.

Image displaying a user interface for configuring OAuth settings in a Python script, with instructions on authorizing access via a Microsoft login URL.

3.6.3) Log in using the account for the mailbox delegate.

Image showing a Microsoft account sign-in interface with options to choose an existing account labeled 'LancomSupport' or use another account.

3.6.4) After logging in, copy the link from the web browser.

Screenshot displaying the label 'CGekee' in a user interface, possibly part of a technical configuration menu.

3.6.5) Paste the link into PowerShell. Successful authentication is acknowledged with the message Authenticated!

Image of a complex computer interface displaying a script toolbar, user directories, coding scripts in Python, Microsoft online configuration options, authorization procedures, and calendar access permissions, with sections to paste authenticated URLs and status updates indicating completion of authentication processes.


3.8) Starting the ePaper update script:

Enter one of the following commands (see also step 2.3): python O365_Update_v3.py .\config.json -i 3 -u required or python O365_Update_24h_v3.py .\config.json -i 3 -u required

The parameter -i stands for the update interval in minutes. In this example, the ePaper server searches for updates every 3 minutes. However, an update is only rolled out to the ePaper displays if there is actually a change.

You can use the Windows Task Scheduler to continuously run the update script.

A screenshot of a computer interface displaying Python scripts and JSON configurations related to updates, labels, and meeting room reservations.