OfficeDeploymentTool: Difference between revisions

From Piszczynski
piszczynski>Aleks
(Created page with " == Office Deployment Tool == For installing Microsoft office in an enterprise environment it may be more suitable to use the office deployment tool rather than the standard...")
 
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 15: Line 15:
The ODT requires the configuration of an xml file to run.  
The ODT requires the configuration of an xml file to run.  


The tool itself is run from the command line with the following command (run as admin):
The tool itself is run from the command line with the following command - run in the same directory as teh setup.exe and configuration xml file (run as admin):
*setup.exe /configuration configXmlFile.xml
First download the required packages:
*.\setup.exe /download .\configXmlFile.xml
 
Then Install:
*.\setup.exe /configure .\configXmlFile.xml


The tool can also be used to download the install package using the /download switch and an xml file.
The tool can also be used to download the install package using the /download switch and an xml file.
You can get a file generated with this tool if you do not want to create it yourself:
https://config.office.com/deploymentsettings


Example xml file
Example xml file
Line 36: Line 44:
      
      
   </Add>
   </Add>
   
  <Display Level="None" AcceptEULA="TRUE" />
   <Property Name="SharedComputerLicensing" Value="1" />
   <Property Name="SharedComputerLicensing" Value="1" />


Line 46: Line 54:
The shared licences is useful for any servers that have multiple users and are compatible with the O365 enterprise licences (E3 + E5 etc)
The shared licences is useful for any servers that have multiple users and are compatible with the O365 enterprise licences (E3 + E5 etc)


To install from a network or local location you will ned to run the /download command first specifying  the location/path in the "Add" section:
The display level sets if the user of the computer will see the installer and if they are required to accept the EULA
 
To install from a network or local location you will need to run the /download command first specifying  the location/path in the "Add" section:
----
----
<pre><Add SourcePath="\\server\networkshare "OfficeClientEdition="64" Channel="Current"></pre>
<pre><Add SourcePath="\\server\networkshare "OfficeClientEdition="64" Channel="Current"></pre>
----
----
The sourcepath will then need to be specified in the xml file used when installing using the /configure switch.
The sourcepath will then need to be specified in the xml file used when installing using the /configure switch.
== After Installation configuration ==
After installing you can update the Office behavior - use the following commands to update/change:
<pre>
rem Mount the default user registry hive
reg load HKU\TempDefault C:\Users\Default\NTUSER.DAT
rem Must be executed with default registry hive mounted.
reg add HKU\TempDefault\SOFTWARE\Policies\Microsoft\office\16.0\common /v InsiderSlabBehavior /t REG_DWORD /d 2 /f
rem Set Outlook's Cached Exchange Mode behavior
rem Must be executed with default registry hive mounted.
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v enable /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v syncwindowsetting /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v CalendarSyncWindowSetting /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v CalendarSyncWindowSettingMonths  /t REG_DWORD /d 1 /f
rem Unmount the default user registry hive
reg unload HKU\TempDefault
rem Set the Office Update UI behavior.
reg add HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /v hideupdatenotifications /t REG_DWORD /d 1 /f
reg add HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /v hideenabledisableupdates /t REG_DWORD /d 1 /f
</pre>
==Office Updates==
Manually check for and install office updates with the following command:<syntaxhighlight lang="powershell">
"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user
</syntaxhighlight>
*
Perform command hidden from users:<syntaxhighlight lang="powershell">
"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user displaylevel=false forceappshutdown=false
</syntaxhighlight>
==Office Activation Issues==
See the following guide for office activation reset:
https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
Check office key being used with the tool:<syntaxhighlight lang="powershell">
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus #run the tool using full path
#go to the location of the office install to run the osp.vbs tool
cscript .\ospp.vbs /dstatus
#can also run to see all installed licenses
cscript .\ospp.vbs /dstatusall
</syntaxhighlight>remove a license key from server:<syntaxhighlight lang="powershell">
cscript .\ospp.vbs /unpkey:<key value obtained from the status command>
</syntaxhighlight>Add license to the server:<syntaxhighlight lang="powershell">
cscript .\ospp.vbs /inpkey:<license key>
</syntaxhighlight>
== Stop Office from trying to register device with AD ==
To stop the user being prompted with pop up message to prompt them to sign into the apps on the device, instead of having them select the "No, this app only" option you can add in a reg key and enable a group policy setting to prevent the device from being azure or hybrid joined:<syntaxhighlight lang="powershell">
#Reg key, add via Group policy with update option
HKLM\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin
DWORD: BlockAADWorkplaceJoin
Value: 1
#Group policy setting:
Computer Configuration > Administrative Templates > Windows Components > Device Registration > Register domain joined computers as devices: Disabled
</syntaxhighlight>

Latest revision as of 17:12, 9 January 2026

Office Deployment Tool

For installing Microsoft office in an enterprise environment it may be more suitable to use the office deployment tool rather than the standard installer downloaded from the office website.

The Office deployment tool allows for an automated installation with options.

See documentation here: https://docs.microsoft.com/en-gb/deployoffice/overview-office-deployment-tool

Download here: https://www.microsoft.com/en-us/download/details.aspx?id=49117


Configuration and Use

The ODT requires the configuration of an xml file to run.

The tool itself is run from the command line with the following command - run in the same directory as teh setup.exe and configuration xml file (run as admin): First download the required packages:

  • .\setup.exe /download .\configXmlFile.xml

Then Install:

  • .\setup.exe /configure .\configXmlFile.xml

The tool can also be used to download the install package using the /download switch and an xml file.

You can get a file generated with this tool if you do not want to create it yourself:

https://config.office.com/deploymentsettings

Example xml file


<Configuration>

  <Add OfficeClientEdition="64" Channel="Current">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-GB" />
      <ExcludeApp ID="Groove" />
      <ExcludeApp ID="Lync" />
      <ExcludeApp ID="Teams" />
      <ExcludeApp ID="OneDrive" />
      <ExcludeApp ID="OneNote" />
    </Product>
    
  </Add>
  <Display Level="None" AcceptEULA="TRUE" />
  <Property Name="SharedComputerLicensing" Value="1" />

</Configuration>

This will configure the install to use the en-gb language with some of the apps excluded from install with the shared licences active.

The shared licences is useful for any servers that have multiple users and are compatible with the O365 enterprise licences (E3 + E5 etc)

The display level sets if the user of the computer will see the installer and if they are required to accept the EULA

To install from a network or local location you will need to run the /download command first specifying the location/path in the "Add" section:


<Add SourcePath="\\server\networkshare "OfficeClientEdition="64" Channel="Current">

The sourcepath will then need to be specified in the xml file used when installing using the /configure switch.

After Installation configuration

After installing you can update the Office behavior - use the following commands to update/change:

rem Mount the default user registry hive
reg load HKU\TempDefault C:\Users\Default\NTUSER.DAT
rem Must be executed with default registry hive mounted.
reg add HKU\TempDefault\SOFTWARE\Policies\Microsoft\office\16.0\common /v InsiderSlabBehavior /t REG_DWORD /d 2 /f
rem Set Outlook's Cached Exchange Mode behavior
rem Must be executed with default registry hive mounted.
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v enable /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v syncwindowsetting /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v CalendarSyncWindowSetting /t REG_DWORD /d 1 /f
reg add "HKU\TempDefault\software\policies\microsoft\office\16.0\outlook\cached mode" /v CalendarSyncWindowSettingMonths  /t REG_DWORD /d 1 /f
rem Unmount the default user registry hive
reg unload HKU\TempDefault

rem Set the Office Update UI behavior.
reg add HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /v hideupdatenotifications /t REG_DWORD /d 1 /f
reg add HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /v hideenabledisableupdates /t REG_DWORD /d 1 /f

Office Updates

Manually check for and install office updates with the following command:

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user

Perform command hidden from users:

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user displaylevel=false forceappshutdown=false

Office Activation Issues

See the following guide for office activation reset:

https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state

Check office key being used with the tool:

cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus #run the tool using full path
#go to the location of the office install to run the osp.vbs tool 
cscript .\ospp.vbs /dstatus 
#can also run to see all installed licenses 
cscript .\ospp.vbs /dstatusall

remove a license key from server:

cscript .\ospp.vbs /unpkey:<key value obtained from the status command>

Add license to the server:

cscript .\ospp.vbs /inpkey:<license key>

Stop Office from trying to register device with AD

To stop the user being prompted with pop up message to prompt them to sign into the apps on the device, instead of having them select the "No, this app only" option you can add in a reg key and enable a group policy setting to prevent the device from being azure or hybrid joined:

#Reg key, add via Group policy with update option
HKLM\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin
DWORD: BlockAADWorkplaceJoin
Value: 1

#Group policy setting:
Computer Configuration > Administrative Templates > Windows Components > Device Registration > Register domain joined computers as devices: Disabled