How Can We Help?
Search for answers or browse our knowledge base.
Install O365 through GPO
configuration.xml
xml
<Configuration>
<Add OfficeClientEdition="64" Channel="Current">
<Product ID="O365ProPlusRetail">
<Language ID="en-us" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
</Product>
</Add>
<Updates Enabled="TRUE" Channel="Current" />
<Display Level="None" AcceptEULA="TRUE" />
<Logging Level="Standard" Path="%temp%\Office365Install" />
<Property Name="AUTOACTIVATE" Value="1" />
</Configuration>Notes:
ExcludeApp ID="Groove"and"Lync"remove OneDrive-for-Business’s old sync client and Skype for Business, which most orgs no longer need — delete those lines if you want them installed.- If you want to exclude Teams or OneDrive, add
<ExcludeApp ID="Teams" />or<ExcludeApp ID="OneDrive" />. - Swap
Channel="Current"for"MonthlyEnterprise"if you want fewer, more predictable update cycles (common for managed enterprise environments). - Change
O365ProPlusRetailtoO365BusinessRetailif these are Microsoft 365 Business (not enterprise) licenses.
InstallOffice.cmd (with logging)
batch
@echo off
setlocal
set "SHARE=\\server\share\Office365"
set "LOGDIR=%SystemRoot%\Temp\Office365Deploy"
set "LOGFILE=%LOGDIR%\install_%COMPUTERNAME%.log"
if not exist "%LOGDIR%" mkdir "%LOGDIR%"
echo [%DATE% %TIME%] Starting Office 365 GPO deployment check on %COMPUTERNAME% >> "%LOGFILE%"
:: Check if Office is already installed via Click-to-Run
reg query "HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" /v "ProductReleaseIds" >nul 2>&1
if %errorlevel% equ 0 (
echo [%DATE% %TIME%] Office already installed. Skipping. >> "%LOGFILE%"
goto end
)
echo [%DATE% %TIME%] Office not found. Beginning install from %SHARE% >> "%LOGFILE%"
if not exist "%SHARE%\setup.exe" (
echo [%DATE% %TIME%] ERROR: setup.exe not found at %SHARE%. Aborting. >> "%LOGFILE%"
goto end
)
"%SHARE%\setup.exe" /configure "%SHARE%\configuration.xml" >> "%LOGFILE%" 2>&1
if %errorlevel% equ 0 (
echo [%DATE% %TIME%] Install command completed successfully. >> "%LOGFILE%"
) else (
echo [%DATE% %TIME%] Install command exited with error code %errorlevel%. >> "%LOGFILE%"
)
:end
echo [%DATE% %TIME%] Script finished. >> "%LOGFILE%"
endlocal
exit /b 0What this adds over the basic version:
- Writes a per-computer log to
C:\Windows\Temp\Office365Deploy\, so you can check individual machines’%LOGFILE%after a GPO push instead of guessing why it failed. - Verifies
setup.exeactually exists on the share before trying to run it (catches broken share permissions or path typos early). - Captures ODT’s own console output/errors into the log via
>> "%LOGFILE%" 2>&1. - Exits cleanly with
exit /b 0so it doesn’t hang the GPO startup script queue even if something inside failed — the log will tell you what happened.
One thing to double check before rollout: make sure the “Domain Computers” group has Read (not just Read & Execute) permissions on the network share — that’s the single most common reason these startup scripts silently fail, since the script itself runs as SYSTEM and needs to reach the share over the network before any user logs in.