Deploy an Office Online Server Environment using PowerShell DSC

In this article we will cover the process of automating the configuration of an Office Online Server 2016 (OOS) using PowerShell Desired State Configuration. The end result will be a fully working OOS environment that has the French Language Pack installed on. Language pack support is something new I recently added to the OfficeOnlineServerDSC module and which will be available starting with version 1.1.0.0 scheduled to be released on December 20th of 2017.

Prerequisites

In my case, I will be starting with a brand new Windows Server 2016 virtual machine on which I downloaded the installation binaries for OOS, as well as the French language pack. The installation media will be stored in a folder right at the root of my c:\ drive at C:\OOSInstall\:

The Language Packs executables need to be extracted in order for the new OfficeOnlineServerInstallLanguagePack resource to be able to do its job. In my case, I downloaded the French Language Pack from MSDN and stored it into C:\OOSLP\:

Office Online Server Language Pack Binaries

Office Online Server Language Pack Binaries

In order to extract the content of the Language Packs, we need to call the .exe file with /extract:. In my case I will be calling the following:

C:\OOSLP\fr_office_online_server_language_pack_march_2017_x64_10267265.exe /extract:C:\OOSLP

this will result in the following set of files to be extracted in our folder:

Extracted Office Online Server Language Pack

Extracted Office Online Server Language Pack

IMPORTANT!!!At the time of publishing this article, OfficeOnlineServerDSC 1.1.0.0 is not yet available on the PowerShell Gallery, therefore you will need to manually acquire it from https://www.GitHub.com/PowerShell/OfficeOnlineServerDSC.

DSC Script

One we have this in place, we are ready to go ahead and execute our DSC configuration script and let the magic happen:

Install-PackageProvider -Name NuGet -Force -Confirm:$false
Install-Module OfficeOnlineServerDSC -RequiredVersion 1.1.0.0 -Force -Confirm:$false -EA SilentlyContinue

Configuration OOS
{
    Import-DscResource -ModuleName OfficeOnlineServerDSC -ModuleVersion 1.1.0.0

    Node localhost
    {
        WindowsFeature WebServer
        {
            Name = "Web-Server"
            Ensure = "Present"
            IncludeAllSubFeature = $true
        }

        OfficeOnlineServerInstall OOSInstall
        {
            Ensure = "Present"
            Path = "C:\OOSInstall\setup.exe"
            DependsOn = "[WindowsFeature]WebServer"
        }

        OfficeOnlineServerInstallLanguagePack FrenchLP
        {
            Ensure = "Present"
            BinaryDir = "C:\OOSLP\"
            Language = "fr-fr"
            DependsOn = "[OfficeOnlineServerInstall]OOSInstall"
        }

        OfficeOnlineServerFarm FarmConfig
        {
            InternalUrl = "http://localhost"
            AllowHttp = $true
        }
    }
}

OOS

Start-DSCConfiguration OOS -Wait -Force -Verbose

Installing Office Online Server for SharePoint 2016

Office Online Server is the next version of the Office Web Apps, which allows your users to view and edit Microsoft Office documents directly in their browsers. It is also a prerequisite to have the Durable Links feature of SharePoint 2016 on-premises work properly. Just like its 2013 predecessor, Office Online Server 2016 needs to be installed on its own server, and cannot coexist with a SharePoint installation. It can still be used as a standalone installation.

In the present article, I will go over the installation process. The farm I will use is a SharePoint 2016 farm hosted in Azure. It has one SQL Server with the SharePoint 2016 Application Server MinRole installed on, a Web-Front end (MinRole), and a standalone Office Online Server (OOS) node.

In this article, we will be installing Office Online Server on an Azure server named AzureSPOOPS (not an typo, the ‘p’ was there for -on-premises). The server is running Windows Server 2012 R2 and is a brand new Azure Cloud Virtual Machine I just created. If you simply try to run the setupe.exe application from the installation media on a new server, you will get the following error. Please note that this article was written at a time when the Office Online Server had just been made available for 3 days, so installation steps and screens are likely to change once the product its RTM.

 

ErrorIIS7Required

As the error message states, we need to first start an enable the Web-Server role on the server in order for the installation to work. This can be done two ways:

1 – Using the Graphical User Interface:

a) Launch Server Manager and click on Manage > Add Roles and Features

AddFeatures

b) Click Next on the first screen

AddFeatures-Screen1

c) Keep the default Role-based or feature-based installation option selected, and click Next

AddFeatures-Screen2

d) Keep the option Select a server from the server pool selected, making sure that the local server in selected in the Server Pool list, and click Next

AddFeatures-Screen3

e) On the Select server roles screen, scroll down to the bottom of the list, and check Web Server (IIS). Click Next

AddFeatures-Screen4

f) A prompt will appear, simply click on the Add Features button

AddFeatures-Screen5

g) On the Select features screen, select Ink and Handwriting Services then click on Next

AddFeatures-Screen6

h) On the Web Server Role (IIS) screen, simply click NextAddFeatures-Screen7

i) On the Select role services screen, keep the default options selected and click NextAddFeatures-Screen8

j) On the Confirm installation selections screen, click on the Install button

AddFeatures-Screen9

Let the installation progress finish and close the window.

2) Use PowerShell:

Using PowerShell, the Web-Server role can be enabled by simply calling the following line of code:

Install-WindowsFeature -Name Web-Server,InkAndHandWritingServices -IncludeAllSubFeature

Install-Features

After a minute or two, the role should be activated and the following output should be shown in the PowerShell console:

PSInstallcomplete


We are now ready to re-run the setup.exe installation application for the Office Online Server. This time, instead of getting the error message, we should be presented with the License Terms screen (yes, the title says Microsoft Office Online Server 2013, which in theory never existed). Click I accept the terms of this agreement and click on the Continue button.

AcceptScreen

Keep the default installation path, unless you have a requirement to put the files in a separate location (e.g. different disk drive). Click on the Install Now button.

InstallNow

Wait for the installation progress to finish

InstallProgress

The installation progress should take about 5-6 minutes. Once completed, you will be presented with the following screen. Simply click on the Close button.

InstallComplete

Creating the Office Online Farm:

After installing the Office Online Server 2016 bits, in order for the product to be usable, we need to configure a new “Farm”. This is achieved with PowerShell, using the following lines of code. Launch a new PowerShell console running as administrator and simply replace the URL with yours:

Import-Module OfficeWebApp
New-OfficeWebAppsFarm -InternalUrl "HTTPS Url" -ExternalUrl "HTTPS Url" -SSLOffloaded –EditingEnabled

*Note SSLOffloaded should only be used in dev/test environments. In production you will want to have the communication done over SSL.

When prompted to turn setting EditingEnabled to TRUE, enter Y. Once completed, the following screen will be shown:

CreateFarm

At this point, our job is done for the Office Online Server 2016 configuration. You can go ahead and test that the “Farm” was successfully created by trying to access http://<server name>/hosting/discovery using Internet Explorer (or edge if using Windows Server 2016 Preview). If everything worked, you should see the server’s XML WOPI output as shown in the figure below:

testconfig

Connecting SharePoint 2016:

Now that the Office Online Server 2016 bits have been installed, the next step is to actually tell our SharePoint 2016 farm about the existence of this new server. In order to do this, launch a new SharePoint Management Shell console on one of the SharePoint 2016 server. What we need to do now is declare a new WOPI binding on the SharePoint server to tell it about the existence of the new Office Online Server 2016 farm. This is done by executing the following line of PowerShell:

New-SPWOPIBinding -ServerName &lt;servername&gt; -AllowHTTP

*Note that -AllowHTTP is ok for non-production environments only. In a production environment you’ll want to ensure communication is done over SSL.

If the command worked, you will see a lot of Office specific properties being output on screen

SPConfig

We are now all set!