Office 365 – Updated deployment guide

I still very often receive questions about how to deploy Office 365 the best way. In a blog I’ve written february 2014 I explain how to deploy Office 365 through MDT.

At the time the installer of Office 365 didn’t wait untill Office 365 was fully installed, instead the installer was initiated and the MDT task sequence proceeded to continue executing other tasks with the impact as a result that if the machine was being rebooted due to a task in the task sequence the installation of Office 365 failed.

Very recently I’ve downloaded the latest version of Office 365 ProPlus Retail, version: 15.0.4745.1001 which I’ve noticed waits during installation until the installation of Office 365 is complete.

In my previous post, I’ve devised a construction, that copied the Office 365 installation files from the MDT deployment share, to the local computer and be executed on the local machine. With the following configure.xml and install.cmd this isn’t necessary anymore:

Second you’ll need to have an Install.cmd that can be called by MDT to execute the installation of Office 365:

This will make sure Office 365 is installed directly from your deploymentshare, without copying files to the local computer and having to clean up those files later.

Just make sure the Office 365 are imported as an application, with the following files residing in the Office 365 folder:

O365update

Cheers! Rens

 

49 thoughts on “Office 365 – Updated deployment guide

  1. Pingback: Office 365 – Automatic deployment of Office 365 with MDT – renshollanders.nl

  2. BW~Merlin

    I am curious as to why you write a CMD file instead of running it as like a normal application install through MDT and use the command setup.exe /CONFIGURE install.xml?

     
    Reply
    1. Rens Hollanders

      Hi,

      Thanks for your question, the reason is simple, CMD can deal with multi line command’s and MDT only executes single lines of command’s.
      When I want to use “”%~DP0” for instance, followed by a second command for the installation, I need a CMD.

      Cheers! Rens

       
      Reply
        1. Rens Hollanders

          Hi Thomas,

          Yes I think it will work, however the procedure as written by “Lauren7060”, isn’t necessary, when you follow my blog’s about Office 365, Office 365 can be retrieved without logging in to any user’s Office 365 portal.

          You can download it directly and install it in a reference image, or post installation phase while doing a machine deployment.

          Cheers! Rens

           
          Reply
    1. Rens Hollanders

      Hi,

      Thanks for your reply, the XML generator is most useful indeed. Thanks for posting!

      Cheers! Rens

       
      Reply
  3. Sanu

    Hello,
    Im trying to install office 365 via MDT 2013.
    I just folowed your guide, but got “Application Microsoft Office 365 x64 returned an unexpected return code: 255”

    Here is my install.cmd
    @echo off
    pushd %~dp0
    echo Installing Office 365 Pro Plus Retail x64
    setup.exe /CONFIGURE install.xml

    My install.xml

    what is wrong here? pls help me.

     
    Reply
  4. Aaron Johnson

    Hello Rens,

    When I was first looking for a way to deploy office 365 through WDS/MDT I followed your guide and it worked great! thank you for posting that guide. On that note I believe I found a quicker work around to just get Office 365 installed as a standard application through a task sequence.

    1. I first downloaded the .exe installer by logging in to the Office 365 portal and clicking install now.

    2. I then created a simple VBS script to install the .exe and placed it in the scripts folder of my deployment share.

    Set WSHShell = WScript.CreateObject(“WScript.Shell”)
    strApp = “%SCRIPTROOT%\IT_Software\Setup.X86.en-us_O365ProPlusRetail_478c633b-4649-4533-bb9b-e3bc5a8140f5_TX_PR_.exe”
    WSHShell.Exec(strApp)

    3. I then added office 365 as a standard application in MDT with the install command of cscript.exe %SCRIPTROOT%\”location of vbs script” and the working directory as %ScriptRoot%\”location of vbs script”

    4. I then made sure that office 365 was the last to install in the task sequence so its not interrupted by restarts. I have not seen anyone else deploy Office 365 like this or be able to do it in four simple steps so i thought it was worth sharing.

    I like this method because total install time is less than 5 minutes(depending on bandwidth from ISP) and it downloads the most current version of office 365. you don’t have to worry about updates because your downloading the most current version and installing it.

     
    Reply
    1. Owen

      This sounds good in principal, however….
      I would have thought you’d need a second script to change your license key?
      As the license key is linked to the exe you download I believe.

       
      Reply
      1. Rens Hollanders

        Hi Owen,

        Thanks for your reply, the files are not linked to a license whatsoever, a Office 365 license is subscribed to your account when you sign in with your Office 365 account when you open lets say Word or Outlook. The first time after installation you’ll be prompted with the question to activate the product. As soon as you sign in, one of your 5 licenses to install on a computer are claimed and can be viewed in your Office 365 portal.

        Cheers! Rens

         
        Reply
  5. FisherKing

    How can I test this? Just have everything in the same folder and run the install.cmd? I’m just learning this stuff and i’m not getting very far unfortunately. I can’t seem to get the install to start. When I run the install.cmd, I get a flash of the command prompt, but that’s it.

     
    Reply
    1. Rens Hollanders

      Hi,
      You need to make shure you run the CMD with elevated permissions, if the CMD immediately disappears after you’ve opened it, open up a CMD prompt and go to the location of the CMD and execute the CMD from the prompt to see any error messages. Also have a look in your task manager to see if the install process ins’t running already or is running after the CMD has disappeared. You need to use the “%~DP0” command to use the relative path and refer to the contents.

      Cheers! Rens

       
      Reply
  6. John

    Hello, I deploy O365 2016 thru SCCM on OSD basis. And all work great. But when i start Outlook on newly deployed machines i get Activate Outlook screen. Do you know if there is any way to get this auto activated, and when users opens for first time all is loaded and running? Looked around alot but no luck so far. Ohh i have tried the autoactivate 1 in conf file. But according to TechNet this has no use so will not work, also checked the registry if shared computers licensing is set to 1 but no luck.

    best regards

     
    Reply
    1. Rens Hollanders

      Hi John,

      O365 is activated through the account through which the software is connected/associated with. So based on my O365 subscription Microsoft can verify if the correct version of Office 365 is presented to the user with the matchin Office 365 plan. As far as I know, this isn’t something that can be automated.

      See this article: https://support.office.com/en-us/article/Activate-Office-365-Office-2016-or-Office-2013-1144e0de-e849-496e-8e33-ed6fb1b34202

      Cheers! Rens

       
      Reply
  7. Jay

    Hey Rens!

    First off thanks for the write up! I wanted to know if you know anything about an error I’m getting during our reference image capture.

    I get:

    Unexpected return code while re-arming Office 2016, RC = -1073425660

    Now I have used the reference image on multiple machine for testing, all seems to be working find. I also know that MDT has some logic in the LTISysprep script where it tries to rearm Office 2016 licencing from KMS licence.

    Should I remove that logic from the script, or point in the right direction? Basically do we want office 365 to “re-arm” during the sysprep phase?

     
    Reply
    1. Rens Hollanders

      Hi Jay,

      Thanks for your reply. Could you check if the path in the VBS matches with this path? C:\Program Files (x86)\Microsoft Office\Office16, since this is the directory to find OSPP.VBS and OSPPREARM.EXE. Otherwise I think you should test it, with these steps in the VBS commented and a custom created “Run Command Line”

      Cheers! Rens

       
      Reply
  8. Bob

    Hi Rens
    I am running the Office 365 install with MDT 2013 Update 2. It runs but doesn’t complete. The errors I receive are below:
    “Event 41034 sent: Application Install – Microsoft Office 365 returned an unexpected return code: -2147418113”

    It seems to timeout…

    ZTI Heartbeat: command has been running for 20 minutes…

    Any ideas?
    Thanks
    Bob

     
    Reply
    1. Rens Hollanders

      Hi Bob,

      One thing I know is that the installation of Office 365 may take some time. However when it times out, or you receive the general error code, then please try to manually install Office 365 through a command line to see if the installation mechanism itself is working. Perhaps you need a reboot upfront for the step, or are there other steps in the way of installing successfully. Cheers! Rens

       
      Reply
      1. Bob

        Thanks Rens

        I think the install is attempting to go out to the internet but haven’t worked out why yet. My XML file is as follows so I would have not expected it to look out to the internet:

        Thanks
        Bob

         
        Reply
  9. Ewing

    Hi Rens,
    What would be the best way to deploy Skype for Business 2016 with SCCM 2012 R2 when my users already have Office 2010? I have been able to get the x64 and x86 install exe’s for SFB 2016 from the Office 365 portal. I encounter error when using CMD silent switches with these exe’s. A manual install works great, but I need a way to silently accept the EULA and disable updates

     
    Reply
    1. Rens Hollanders

      Hi Ewing,

      This is possible in my opinion with a custom MSI that will not deïnstall Office 2010. Also be sure your Skype For Business 2016 is also an MSI installation, since MSI versions of Office, and Click-to-Run software don’t mix well. It can cause integration errors between the programs.

      I think that’s it.

      Cheers! Rens

       
      Reply
    1. Rens Hollanders

      Not for installation of-course, but for download of the installation files certainly

      Cheers! Rens

       
      Reply
  10. Carlos Rivera

    Hello Rens,
    I’ve followed your guide and I’m running into the same issue as Sanu above and I have the same setup/config as her. I’m getting a 255 error code. I didn’t see any response back to her issue. Do you know that this 255 error code is?

    Thanks for all your guides.
    Carlos

     
    Reply
    1. Rens Hollanders

      Hello Carlos,

      Thank you for your question. To be honest, I have no clue. I’ve googled the error code myself and there are several 255-x codes.
      255-13 can occur when you have a virusscanner installed
      255-6 when office is not working correctly or when repairing office
      255-11 when insufficient updates are installed

      So I think you need to dig deeper, what happens when you perform a manual install (preferably without an internet connection)

      Cheers! Rens

       
      Reply
  11. Leo

    Hello Rens
    I’m trying the instructions you provided but not having any luck. When I test the install.cmd by running it in an elevated command prompt I get the following error: The syntax of the command is incorrect. The xml file works as I tested it as well in an elevated command prompt & it installed ok. I think my install.cmd is the issue. Please advise.

    @echo off
    pushd %~dp0
    echo Installing Office 2016 Pro Plus Retail x64
    setup.exe /CONFIGURE install.xml

     
    Reply
    1. Rens Hollanders

      Hi Leo,

      Is User Account Control enabled on the system or the server serving the files? If so, please disable it.

      Let me know.

      Cheers! Rens

       
      Reply
    2. Rens Hollanders

      Hi Leo,

      Not sure what could be wrong here, perhaps you need to add “” for the absolute path?

      Cheers! Rens

       
      Reply
  12. Craig

    Hi Rens

    is the task sequence still required with the new method or is the application calling install.cmd enough?

    Thanks
    Craig

     
    Reply
    1. Rens Hollanders

      Hi Craig,

      The CMD can work separately from the task sequence. If you just want to distribute Office 365, it’s not necessary to use MDT.

      Cheers! Rens

       
      Reply
      1. Craig

        I need to push it out via MDT as part of a thin image.

        I’m new to MDT and don’t really understand the purpose of the TS as the install.cmd runs the setup and the install.xml configures it?

        Thanks
        Craig

         
        Reply
        1. Rens Hollanders

          Hi Craig,

          The install.cmd is used because the application commandline can only handle one commandline, and not multiple. So we have an application, which calls a cmd, which installs the application.

          Cheers! Rens

           
          Reply
          1. Craig

            Does this look right?

            Install.cmd

            @echo off
            pushd %~dp0
            echo Installing Office 365 Pro Plus Retail x86
            setup.exe /CONFIGURE install.xml

            Install.xml

            I notice the the source path in install.xml is blank should point back to the deployment share?

            I also get the 255 error after the MDT deployment finishes. I’ve seen another post referencing this error in an earlier post. Was there an outcome?

            Your help is very much appreciated.

            Thanks
            Craig

             
          2. Rens Hollanders

            Craig,

            You can use %~DP0 also seperately for each file, once for the executable, the second time for the xml file. You can try this:

            “xcopy “%~DP0*.*” C:\Windows\Temp\O365SmallBusPremRetail /E /I /Y
            C:\Windows\Temp\O365SmallBusPremRetail\setup.exe /CONFIGURE install.xml
            REM rmdir C:\Windows\Temp\O365SmallBusPremRetail /S /Q
            exit”

            this copies the source locally

            Cheers! Rens

             
  13. Angela McCarthy

    Hi Ren

    Great guide. Thanks for supplying. I’m having issues with mine where I want users to activate the software using their email, however we also have a KMS server so it auto-activates against that instead. What can I do to stop that?

    Thanks
    Angela

     
    Reply
    1. Rens Hollanders

      Hi Angela,
      Thanks, I’m not aware Office 365 will activate against KMS. To my knowledge it will always try to connect with the internet and contact Microsoft Servers. Also see this reference: https://technet.microsoft.com/nl-nl/library/gg982959.aspx in particular this paragraph: “Because of its online activation features, Office 365 ProPlus won’t work on computers that are completely cut off from the Internet. For those computers, we recommend installing Office Professional Plus 2016 and using a traditional activation method such as Key Management Service (KMS) or Active Directory Domain Services.”

      First thing I always notice when starting Office 365 client is to register an Office 365 subscribed e-mail address matching the correct software with the correct Office 365 subscription plan.
      Are you sure no GPO setting is causing this?

      Cheers! Rens

       
      Reply
      1. Angela

        Hi Ren

        This is what I have done:
        I’ve created a download.xml file to extract out the contents
        – extracted contents: http://imgur.com/nGU1zoa

        Once that was done, I had a install.xml file created with the following config
        —-

        —-

        Then I imported it into MDT and added the command line:
        http://imgur.com/0gPntNK

        After doing a test deploy though and running C:\Program Files (x86)\Microsoft Office\Office16>cscript ospp.vbs /dstatus it still shows as activated against KMS
        http://imgur.com/BGMyOgl

        ==================

        So second step, I went through and did this:
        install.cmd
        @echo off
        pushd %~dp0
        echo Installing Office 365 Pro Plus Retail x86 English
        setup.exe /CONFIGURE install.xml

        http://imgur.com/cVCXtM8

        Using the same files as above. I think I’ve missed a step. 🙁 Can you see where I have gone wrong?

        Both methods are activating straight away against KMS and I can’t stop it from activating, so I’m really confused as to what is happening.

        Thanks Ren.

         
        Reply
          1. Rens Hollanders

            Good day Angela,
            Perhaps this could be a solution, I don’t know how you have generated the XML but this can automatically do it for you based on the properties:https://officedev.github.io/Office-IT-Pro-Deployment-Scripts/XmlEditor.html
            I don’t notice anything wrong in your XML file. However when I perform a cscript ospp.vbs /dstatus, I have the following info: http://renshollanders.nl/wp-content/uploads/2017/04/OfficeStatus.png

            What happens when you install the software on a (virtual) machine, with no internet connection and no domain policies, and now connection to the KMS?

            Regards, Rens

             
  14. Mike D

    I encountered several installation issue with MDT deployment, but I eventually got it working.

    I received the return error code 255 also, but I think that removing “” from the install.cmd resolved it.

    I also referenced these instructions: http://www.itninja.com/software/microsoft/office-2016/16-150

    Quick recap of instructions:
    • Download Microsoft Office 2016 ODT – http://www.microsoft.com/en-us/download/details.aspx?id=49117&WT
    • Install Microsoft ODT to path
    • Copy Setup.exe & *.xml file to \…MDTBuildLab\Applications\Microsoft Office 2016
    • Open CMD on C:\ODTÒfficeBasic and run Setup /download configration.xml
    • This will download the needed package for Office installation
    • Edit the file Configuration.xml

    Contents of configuration.xml

    Create install.cmd

    echo off
    pushd %~dp0
    echo Installing Office 365 Pro Plus Retail x86
    setup /configure Configuration.xml

    Create task sequence that runs install.cmd from .\applications\Microsoft Office 2016 working directory

     
    Reply
  15. Mike D

    Oh No, my previous comment lost content where it says:

    but I think that removing “” from the install.cmd resolved it.

    should be

    but I think that removing [less than sign] insert_language_here [more than sign] from the install.cmd resolved it.

    Thanks for the write-up too!

     
    Reply
  16. Troy

    very nice write up, I have often wondered if I could do deploy software with MDT. I feel like I am comfortable with both MDT and Office 365 ProPlus and how to setup and configure both of them. So I feel stupid not being able to figure out your solution.

    I think i am missing one important thing here though. How are the machines targeted for the deployment of O365? Or how are they initiating the deployment?

    I know this is an old post but I am hoping you can reply because i could certainly put this to use.

    thanks

     
    Reply
    1. Rens Hollanders

      Troy,

      The installation is part of the task sequence. You can either create different task sequence for installation of office 2016 MSI or office 365, or use condition’s, but then you need to find a specific object which you can query and make a dependency based on that specific object. You may also choose to have a check box during installation for which version you want to deploy.

      This answers your question?

      Cheers! Rens

       
      Reply
  17. Troy

    thank you so much for the very quick reply. I apologize for not asking the question properly.

    I want to install O365 via MDT just like what your post is all about. What I dont understand is how you get the deployment to kick off for the end user. For example: You know how in SCCM you target a collection of machines or users with a deployment of software either via a required push where the installation kicks off at a predetermined time. Or via the Software Center where the end user can select the software installation to run at their convenience.

    Well what I am missing from your post is how do i get the task sequence created in MDT that has the O365 install in to the end users. MDT requires that someone run litetouch.vbs to run and make the task sequence available. How do I do that with your solution?

    thank you very much

     
    Reply
    1. Rens Hollanders

      You can try GPO, scheduled task, or create an instruction for people to run a CMD from a network share. If a machine is already installed I wouldn’t use MDT to push software to it. There are other solutions you’ll need to address to for pushing applications to already installed workstations.

      Cheers! Rens

       
      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *